diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2023-04-03 01:14:58 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2023-04-03 01:14:58 +0300 |
commit | d747677c2860326e7d673861319dcb0e2149daa4 (patch) | |
tree | 640c4bbca466665eee68e4735688b3cdd4022ee3 /bin/ak-comments | |
parent | 4f8fb0a8acd5eec0caaf1087d7ecf91f9166c807 (diff) | |
download | arching-kaos-tools-d747677c2860326e7d673861319dcb0e2149daa4.tar.gz arching-kaos-tools-d747677c2860326e7d673861319dcb0e2149daa4.tar.bz2 arching-kaos-tools-d747677c2860326e7d673861319dcb0e2149daa4.zip |
Fixed temporary folder creation
Diffstat (limited to 'bin/ak-comments')
-rwxr-xr-x | bin/ak-comments | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/bin/ak-comments b/bin/ak-comments index 2934e00..7feb889 100755 --- a/bin/ak-comments +++ b/bin/ak-comments @@ -9,19 +9,7 @@ if [ ! -d $ZCOMMENTSDIR ]; then else ak-logthis "[INFO]" "zcommentsdir found" fi -tempassin(){ - if [ ! -z $1 ] - then - TEMPASSIN="$1" - else - TIMESTAMP="$(date -u +%s)" - TEMPASSIN="/tmp/aktmp_$TIMESTAMP" - fi - if [ ! -d $TEMPASSIN ]; then - mkdir $TEMPASSIN - fi - cd $TEMPASSIN -} + create(){ if [ ! -z $1 ] then @@ -31,7 +19,8 @@ create(){ echo "[ERROR]" "No reference given" exit 1 fi - tempassin $TEMP + TEMP="$(ak-tempassin)" + cd $TEMP export COMMENTS_FILE="$(date -u +%s)" vi $COMMENTS_FILE echo "Renaming..." @@ -65,7 +54,8 @@ title(){ echo comments } add(){ - tempassin + TEMP="$(ak-tempassin)" + cd $TEMP if [ -f "$ZCOMMENTSDIR/$1" ]; then FILE=$ZCOMMENTSDIR/$1 echo "Adding comments from " $FILE |