Skip to content

Commit d33a442

Browse files
committed
Bugfix: Create the notes directory if it doesn't exist.
1 parent 9e24c23 commit d33a442

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

notes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ configured_dir=${NOTES_DIRECTORY%/} # Remove trailing slashes
1212
notes_dir="${configured_dir:-$HOME/notes}"
1313
escaped_notes_dir="$(printf "$notes_dir" | sed -e 's/[]\/$*.^|[]/\\&/g')"
1414

15+
# Make sure the notes directory actually exists, and create it if it doesn't
16+
if [ ! -d "$notes_dir" ]; then
17+
mkdir -p "$notes_dir"
18+
fi
19+
1520
# If no $EDITOR, look for `editor` (symlink on debian/ubuntu/etc)
1621
if [ -z "$EDITOR" ] && type editor &>/dev/null; then
1722
EDITOR=editor

0 commit comments

Comments
 (0)