aboutsummaryrefslogtreecommitdiff
path: root/bin/td
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-01 15:20:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-01 15:20:13 +1200
commit0b3d124d7816b996864424bfd43e679aa10cab43 (patch)
tree86751f2a2930b686d8b896647b735c65d71caef4 /bin/td
parentRemove unused variable in td(1) (diff)
downloaddotfiles-0b3d124d7816b996864424bfd43e679aa10cab43.tar.gz
dotfiles-0b3d124d7816b996864424bfd43e679aa10cab43.zip
Quote vars correctly within expansions in td(1)
Diffstat (limited to 'bin/td')
-rwxr-xr-xbin/td6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/td b/bin/td
index 53e3fbd6..6d9aa064 100755
--- a/bin/td
+++ b/bin/td
@@ -2,8 +2,8 @@
# Manage to-do files with just $EDITOR and git(1)
# Specify the path and file
-dir=${TODO_DIR:-$HOME/Todo}
-file=${1:-${TODO_NAME:-todo}}
+dir=${TODO_DIR:-"$HOME"/Todo}
+file=${1:-"${TODO_NAME:-todo}"}
# If the directory doesn't exist, create it
[ -d "$dir" ] || mkdir -p -- "$dir" || exit
@@ -22,7 +22,7 @@ isgr || git init || exit
[ -e "$file" ] || touch -- "$file" || exit
# Launch $VISUAL (or $EDITOR (or vi(1))) to edit the appropriate to-do file
-"${VISUAL:-${EDITOR:-vi}}" "$file"
+"${VISUAL:-"${EDITOR:-vi}"}" "$file"
# Add the file to the changeset
git add -- "$file"