diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-18 02:07:52 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-18 02:07:52 +0200 |
commit | 759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0 (patch) | |
tree | cf521106526cf5b732ce3f4c3cea027ab35fa5e7 /bin/ak-categories | |
parent | 8c63f5493b101b1af9653c2af120c56d98c811a4 (diff) | |
download | arching-kaos-tools-759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0.tar.gz arching-kaos-tools-759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0.tar.bz2 arching-kaos-tools-759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0.zip |
Renamed lib logit to _ak_logit
Affected scripts:
- ak
- ak-articles
- ak-categories
- ak-comments
- ak-data-expand
- ak-enter
- ak-files
- ak-find-latest-mined-sblock
- ak-folders
- ak-follow
- ak-following
- ak-fs-add
- ak-ipfs-check
- ak-ipns-resolve
- ak-news
- ak-profile
- ak-schain-latest-cached
- ak-sm-files
- ak-sm-filesplitter
- ak-stellar-get-participants
- ak-tempassin
- ak-todos
- ak-transactions
- ak-zblock-cache
- ak-zblock-manipulator
- ak-zblock-pack
- ak-zblock-show
- ak-zchain-chk
Diffstat (limited to 'bin/ak-categories')
-rwxr-xr-x | bin/ak-categories | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bin/ak-categories b/bin/ak-categories index e50e1fc..292e789 100755 --- a/bin/ak-categories +++ b/bin/ak-categories @@ -2,13 +2,14 @@ AK_CATEGORIES="$AK_WORKDIR/categories" PROGRAM="$(basename $0)" -echo $AK_CATEGORIES +source $AK_LIBDIR/_ak_logit + if [ ! -d $AK_CATEGORIES ]; then mkdir $AK_CATEGORIES cd $AK_CATEGORIES - echo "AK_CATEGORIES created" + logit "INFO" "AK_CATEGORIES created" else - echo "AK_CATEGORIES found" + logit "INFO" "AK_CATEGORIES found" fi _ak_modules_categories_create(){ @@ -16,7 +17,7 @@ _ak_modules_categories_create(){ cd $TEMP export NEWS_FILE="$(date +%Y%m%d_%H%M%S)" vi $NEWS_FILE - echo "Renaming..." + logit "INFO" "Renaming..." TITLE="$(head -n 1 $NEWS_FILE)" TO_FILE=$NEWS_FILE-$(echo $TITLE | tr '[:upper:]' '[:lower:]' | sed -e 's/ /\_/g' ) IPFS_FILE=$(ak-ipfs-add $NEWS_FILE) @@ -46,10 +47,10 @@ _ak_modules_categories_import(){ then if [ ! -d $1 ] then - echo "Folder does not exists" + logit "ERROR" "Folder does not exists" exit 4 else - echo "Folder $1 exists" + logit "INFO" "Folder $1 exists" fl="$(ls -1 $1)" for f in $fl do @@ -57,7 +58,7 @@ _ak_modules_categories_import(){ done fi else - echo "No value" + logit "ERROR" "No value" exit 6 fi exit 224 @@ -67,7 +68,7 @@ _ak_modules_categories_add(){ cd $TEMP if [ -f $1 ]; then FILE="$1" - echo "Adding news from " $FILE + logit "INFO" "Adding news from " $FILE DATETIME=$(echo $FILE | cut -d - -f 1 | awk '{print $1}') TITLE=$(head -n 1 $FILE) FILE_IPFS_HASH=$(ak-ipfs-add $FILE) @@ -105,7 +106,7 @@ _ak_modules_categories_usage(){ echo " newsletter and it's going to be saved" exit 0 } -_ak_modules_categories_title + if [ ! -z $1 ]; then case $1 in -h | --help) _ak_modules_categories_usage; exit;; |