aboutsummaryrefslogtreecommitdiff
path: root/modules/articles
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-14 22:36:12 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-14 22:36:12 +0300
commit4217dc0560bf40b4fa7ae6a6f964bd56b418712e (patch)
tree020e304e23b29d0eb12199c2f605f1262a3beb04 /modules/articles
parent7743751290bb4e7678940be65725a48386e7b986 (diff)
downloadarching-kaos-tools-4217dc0560bf40b4fa7ae6a6f964bd56b418712e.tar.gz
arching-kaos-tools-4217dc0560bf40b4fa7ae6a6f964bd56b418712e.tar.bz2
arching-kaos-tools-4217dc0560bf40b4fa7ae6a6f964bd56b418712e.zip
Refactoring
Diffstat (limited to 'modules/articles')
-rwxr-xr-xmodules/articles/main.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/articles/main.sh b/modules/articles/main.sh
index 382466b..29c1c34 100755
--- a/modules/articles/main.sh
+++ b/modules/articles/main.sh
@@ -22,9 +22,9 @@ TEMP="/tmp/aktmp"
if [ ! -d $ZARTICLESDIR ]; then
mkdir $ZARTICLESDIR
cd $ZARTICLESDIR
- logit "INFO" "zarticlesdir created"
+ _ak_log_info "zarticlesdir created"
else
- logit "INFO" "zarticlesdir found"
+ _ak_log_info "zarticlesdir found"
fi
_ak_modules_articles_create(){
@@ -33,18 +33,18 @@ _ak_modules_articles_create(){
export ARTICLES_FILE="$(date +%Y%m%d_%H%M%S)"
if [ -z $EDITOR ]
then
- logit "ERROR" "No $EDITOR found. Exiting..."
+ _ak_log_error "No $EDITOR found. Exiting..."
exit 1
fi
$EDITOR $ARTICLES_FILE
- logit "INFO" "Renaming..."
+ _ak_log_info "Renaming..."
TITLE="$(head -n 1 $ARTICLES_FILE)"
TO_FILE=$ARTICLES_FILE-$(echo $TITLE | tr '[:upper:]' '[:lower:]' | sed -e 's/ /\_/g' )
IPFS_FILE=$(_ak_ipfs_add $ARTICLES_FILE)
mv $ARTICLES_FILE $ZARTICLESDIR/$TO_FILE
sed -e 's,Qm.*,'"$IPFS_FILE"',g' $ZARTICLESDIR/README
_ak_modules_articles_add $ZARTICLESDIR/$TO_FILE
- logit "INFO" "Adding to git repo..."
+ _ak_log_info "Adding to git repo..."
cd $ZARTICLESDIR
rm -rf $TEMP
}