diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-11 19:36:28 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-11 19:36:28 +0200 |
commit | bf87d94330c6c6153eab9f1a3016efeef5ebc754 (patch) | |
tree | 99ca0366d4d956848d8793130734e5761794dade /bin/ak-news | |
parent | d4e498a18f700e288764cdf8799a2b07a76e1615 (diff) | |
download | arching-kaos-tools-bf87d94330c6c6153eab9f1a3016efeef5ebc754.tar.gz arching-kaos-tools-bf87d94330c6c6153eab9f1a3016efeef5ebc754.tar.bz2 arching-kaos-tools-bf87d94330c6c6153eab9f1a3016efeef5ebc754.zip |
Introduced ./lib for common stuff
ofc, logit was the first lib to add... finally
Diffstat (limited to 'bin/ak-news')
-rwxr-xr-x | bin/ak-news | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/bin/ak-news b/bin/ak-news index 2a787dc..fe7a003 100755 --- a/bin/ak-news +++ b/bin/ak-news @@ -5,18 +5,15 @@ descriptionString="Module to read, create and add zblocks" ZNEWSDIR="$AK_WORKDIR/news" TEMP="/tmp/aktmp" -logit(){ - ak-logthis "$PROGRAM" "$1" "$2" -} +source $AK_LIBDIR/logit if [ ! -d $ZNEWSDIR ]; then mkdir $ZNEWSDIR - if [ "$?" == 0 ]; then - logit "INFO" "$ZNEWSDIR created" - else + if [ $? -ne 0 ]; then logit "ERROR" "$ZNEWSDIR couldn't be created" exit 1 fi + logit "INFO" "$ZNEWSDIR created" else logit "INFO" "$ZNEWSDIR found" fi @@ -35,9 +32,8 @@ _ak_modules_news_create(){ TO_FILE=$NEWS_FILE-$(echo $TITLE | tr '[:upper:]' '[:lower:]' | sed -e 's/ /\_/g' ) IPFS_FILE=$(ak-ipfs-add $NEWS_FILE) mv $NEWS_FILE $ZNEWSDIR/$TO_FILE - sed -e 's,Qm.*,'"$IPFS_FILE"',g' $ZNEWSDIR/README + sed -i -e 's,Qm.*,'"$IPFS_FILE"',g' $ZNEWSDIR/README _ak_modules_news_add $TO_FILE - echo "Adding to git repo..." cd $ZNEWSDIR # rm -rf $TEMP } |