Skip to content

Commit 94edfb6

Browse files
committed
Fix bug if your $EDITOR contains a space
1 parent 4fed6f0 commit 94edfb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

notes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ notes_dir="${configured_dir:-$HOME/notes}"
55
escaped_notes_dir=$(printf $notes_dir | sed -e 's/[]\/$*.^|[]/\\&/g')
66

77
# If no $EDITOR, look for `editor` (symlink on debian/ubuntu/etc)
8-
if [ -z $EDITOR ] && type editor &>/dev/null; then
8+
if [ -z "$EDITOR" ] && type editor &>/dev/null; then
99
EDITOR=editor
1010
fi
1111

@@ -18,7 +18,7 @@ find_notes() {
1818
find_result=$?
1919
formatted_output=$(printf "$find_output" | without_notes_dir)
2020

21-
if [[ $find_result == 0 && $formatted_output ]]; then
21+
if [[ $find_result == 0 && "$formatted_output" ]]; then
2222
printf "$formatted_output\n"
2323
return 0
2424
else
@@ -36,7 +36,7 @@ grep_notes() {
3636
grep_result=$?
3737
formatted_output=$(printf "$grep_output" | without_notes_dir)
3838

39-
if [[ $grep_result == 0 && $formatted_output ]]; then
39+
if [[ $grep_result == 0 && "$formatted_output" ]]; then
4040
printf "$formatted_output\n"
4141
return 0
4242
else

0 commit comments

Comments
 (0)