We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e13b18d + 49654ac commit 3e7bfeeCopy full SHA for 3e7bfee
notes
@@ -69,6 +69,10 @@ open_note() {
69
if [ ! -f "$note_path" ]; then
70
note_path="$notes_dir/$note_path"
71
fi
72
+ if [ -z "$EDITOR" ]; then
73
+ printf "Please set \$EDITOR to edit notes\n"
74
+ exit 1
75
+ fi
76
77
$EDITOR "$note_path" < /dev/tty
78
}
test/test-open.bats
@@ -29,6 +29,13 @@ notes="./notes"
29
assert_output "Opening $HOME/notes"
30
31
32
+@test "Exits if EDITOR not configured" {
33
+ unset EDITOR
34
+ run $notes open test
35
+
36
+ assert_failure
37
+}
38
39
@test "Opens the configured notes directory if set" {
40
run $notes open
41
0 commit comments