aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-folders
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-03-01 19:26:24 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-03-01 19:26:24 +0200
commitf8d2236e55e5c369b218017d1de1058d6a8ee361 (patch)
tree1cdd4ea1476c3062d3dd38ee1ba62d6bb98eb680 /bin/ak-folders
parent7affa2082f61455a413d0c8fea08e79935d4f308 (diff)
downloadarching-kaos-tools-f8d2236e55e5c369b218017d1de1058d6a8ee361.tar.gz
arching-kaos-tools-f8d2236e55e5c369b218017d1de1058d6a8ee361.tar.bz2
arching-kaos-tools-f8d2236e55e5c369b218017d1de1058d6a8ee361.zip
Log formatting adjustment
Diffstat (limited to 'bin/ak-folders')
-rwxr-xr-xbin/ak-folders28
1 files changed, 15 insertions, 13 deletions
diff --git a/bin/ak-folders b/bin/ak-folders
index 2a28dd9..280af2b 100755
--- a/bin/ak-folders
+++ b/bin/ak-folders
@@ -5,21 +5,24 @@ ZFOLDERSDIR="$AK_WORKDIR/folders"
TEMP="/tmp/aktmp"
logit(){
- ak-logthis "<$PROGRAM>" "$1" "$2"
+ ak-logthis "$PROGRAM" "$1" "$2"
}
if [ ! -d $ZFOLDERSDIR ]; then
mkdir $ZFOLDERSDIR
- cd $ZFOLDERSDIR
+ logit "ERROR" "error $ZFOLDERSDIR not found or/and could not be created"
else
- logit "[ERROR]" "error $ZFOLDERSDIR not found or/and could not be created"
+ logit "INFO" "Found $ZFOLDERSDIR"
+ exit 1
fi
TEMPASSIN="$(ak-tempassin)"
cd $TEMPASSIN
_ak_modules_folders_usage(){
_ak_modules_folders_title
- echo "$PROGRAM - folder"
+ echo ""
+ echo " -h, --help Show this message"
+ echo " add <folder> Try ak-folders add <folder>"
}
_ak_modules_folders_add(){
@@ -33,24 +36,24 @@ _ak_modules_folders_main(){
FOLDERNAME="$1"
CRP="$2"
echo "Adding $FOLDERNAME"
- logit "[INFO]" "Copying $1 to temporary folder"
+ logit "INFO" "Copying $1 to temporary folder"
cp -r $2/$1 $1
if [ $? == 0 ]; then
- logit "[INFO]" "Copied successfully"
+ logit "INFO" "Copied successfully"
else
- logit "[ERROR]" "Error copying..."
+ logit "ERROR" "Error copying..."
fi
FOLDER="$1"
- logit "[INFO]" "Adding $FOLDER to IPFS..."
+ logit "INFO" "Adding $FOLDER to IPFS..."
FOLDER_IPFS_HASH=$(ak-ipfs-add $FOLDER)
if [ $? == 0 ]; then
- logit "[INFO]" "done"
+ logit "INFO" "done"
else
- logit "[ERROR]" "error"
+ logit "ERROR" "error"
fi
- logit "[WARNING]" "Folders are not signing..."
+ logit "WARNING" "Folders are not signing..."
printf '{"timestamp":"%s","foldername":"%s","ipfs":"%s"}' $(date -u +%s) $FOLDERNAME $FOLDER_IPFS_HASH
@@ -69,8 +72,7 @@ _ak_modules_folders_main(){
}
_ak_modules_folders_title(){
- echo "$PROGRAM"
- echo "Folder block creator"
+ echo "$PROGRAM - Folder block creator"
}