From cd43e57b999422980ea95df7f1d03117342e358e Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 1 Mar 2024 09:36:53 +0200 Subject: Simplifying logs --- bin/ak-follow | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bin/ak-follow') diff --git a/bin/ak-follow b/bin/ak-follow index 0d6107c..a4ca070 100755 --- a/bin/ak-follow +++ b/bin/ak-follow @@ -1,19 +1,22 @@ #!/bin/bash FOLLOWING="$HOME/.arching-kaos/following" PROGRAM="$(basename $0)" +logit(){ + ak-logthis "$PROGRAM" "$1" "$2" +} if [ ! -z $1 ] then grep $1 $FOLLOWING if [ $? == 0 ] then - ak-logthis "<$(basename $0)>" "[ERROR]" "Already exists" + logit "ERROR" "Already exists" exit 1 fi echo $1 >> $FOLLOWING IPFS=$(ak-ipfs-add $FOLLOWING) if [ $? != 0 ] then - ak-logthis "<$PROGRAM>" "[ERROR]" "Addition failed" + logit "ERROR" "Addition failed" exit 1 fi ak-profile set following $IPFS -- cgit v1.2.3