From 5e1473d67381ba1a16a2453a5f90331421367a05 Mon Sep 17 00:00:00 2001 From: atisne Date: Fri, 22 Dec 2017 15:12:26 +0100 Subject: [PATCH 1/2] Quotes do not expand ~ (home directory) --- tasknote | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasknote b/tasknote index a041861..8e4f432 100755 --- a/tasknote +++ b/tasknote @@ -44,7 +44,7 @@ VIEWER=cat # FOLDER to store notes in. Must already exist. # If you sync tasks, FOLDER should be a location that syncs and is available to # other computers, i.e. ~/dropbox/tasknotes -FOLDER="~/Dropbox/tasks/notes/" +FOLDER=~/Dropbox/tasks/notes/ # Check for existence of $FOLDER if [ ! -d $FOLDER ]; then @@ -78,8 +78,7 @@ fi uuid=`$TASKBIN $1 uuids` # build full path & file name to store notes in -folder=`echo $FOLDER | sed "s|^~|$HOME|"` -file="$folder$uuid$EXT" +file="$FOLDER$uuid$EXT" # determine if notes file already exists fileexists=0 From 95dfbe7d9b89cb66476313914b72592fc8c81957 Mon Sep 17 00:00:00 2001 From: atisne Date: Fri, 22 Dec 2017 16:35:39 +0100 Subject: [PATCH 2/2] Allow to forget a trailing slash to FOLDER --- tasknote | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasknote b/tasknote index 8e4f432..4843453 100755 --- a/tasknote +++ b/tasknote @@ -78,6 +78,8 @@ fi uuid=`$TASKBIN $1 uuids` # build full path & file name to store notes in +# ensure FOLDER ends with a slash +[ "${FOLDER: -1}" != "/" ] && FOLDER=$FOLDER/ file="$FOLDER$uuid$EXT" # determine if notes file already exists