Skip to content

Commit

Permalink
Bugfix: Create the notes directory if it doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
primis committed May 8, 2017
1 parent 9e24c23 commit d33a442
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions notes
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ configured_dir=${NOTES_DIRECTORY%/} # Remove trailing slashes
notes_dir="${configured_dir:-$HOME/notes}"
escaped_notes_dir="$(printf "$notes_dir" | sed -e 's/[]\/$*.^|[]/\\&/g')"

# Make sure the notes directory actually exists, and create it if it doesn't
if [ ! -d "$notes_dir" ]; then
mkdir -p "$notes_dir"
fi

# If no $EDITOR, look for `editor` (symlink on debian/ubuntu/etc)
if [ -z "$EDITOR" ] && type editor &>/dev/null; then
EDITOR=editor
Expand Down

0 comments on commit d33a442

Please sign in to comment.