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.
1 parent be7d1f7 commit 49654acCopy full SHA for 49654ac
notes
@@ -67,6 +67,10 @@ open_note() {
67
if [ ! -f "$note_path" ]; then
68
note_path="$notes_dir/$note_path"
69
fi
70
+ if [ -z "$EDITOR" ]; then
71
+ printf "Please set \$EDITOR to edit notes\n"
72
+ exit 1
73
+ fi
74
75
$EDITOR "$note_path" < /dev/tty
76
}
test/test-open.bats
@@ -28,6 +28,13 @@ notes="./notes"
28
assert_output "Opening $HOME/notes"
29
30
31
+@test "Exits if EDITOR not configured" {
32
+ unset EDITOR
33
+ run $notes open test
34
+
35
+ assert_failure
36
+}
37
38
@test "Opens the configured notes directory if set" {
39
run $notes open
40
0 commit comments