File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- EDITOR=${EDITOR:- editor}
4
-
5
3
configured_dir=${NOTES_DIRECTORY%/ } # Remove trailing slashes
6
4
notes_dir=" ${configured_dir:- $HOME / notes} "
7
5
escaped_notes_dir=$( printf $notes_dir | sed -e ' s/[]\/$*.^|[]/\\&/g' )
8
6
7
+ # If no $EDITOR, look for `editor` (symlink on debian/ubuntu/etc)
8
+ if [ -z $EDITOR ] && type editor & > /dev/null; then
9
+ EDITOR=editor
10
+ fi
11
+
9
12
without_notes_dir () {
10
13
cat | sed -e s/^$escaped_notes_dir //g | sed -E " s/^\/+//g"
11
14
}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ notes="./notes"
34
34
run $notes open test
35
35
36
36
assert_failure
37
+ assert_output " Please set \$ EDITOR to edit notes"
37
38
}
38
39
39
40
@test " Opens the configured notes directory if set" {
You can’t perform that action at this time.
0 commit comments