Skip to content

Commit

Permalink
Added abiility to create quicknote in subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
apatil committed Sep 24, 2018
1 parent 1275e51 commit 658ba00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ There are also more complex options available. You can set any configuration pro

### `notes new <note-name>`

Opens your `$EDITOR` of choice for a new note, with the given name. The name can include slashes, if you want to put your note in a subfolder. Leave out the name if you want one to be generated for you (e.g. `quicknote-2016-12-21.md` - format configurable with `$QUICKNOTE_FORMAT`). Shorthand alias also available with `notes n`.
Opens your `$EDITOR` of choice for a new note, with the given name. The name can include slashes, if you want to put your note in a subfolder. Leave out the name if you want one to be generated for you (e.g. `quicknote-2016-12-21.md` - format configurable with `$QUICKNOTE_FORMAT`). If you want to place a quicknote in a subfolder, use a trailing slash: `notes new subfolder/`. Shorthand alias also available with `notes n`.

### `notes find <part-of-a-note-name>`

Expand Down
5 changes: 5 additions & 0 deletions notes
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ new_note() {
if [[ $note_name == "" ]]; then
note_name="$(generate_name)"
fi

if echo "$note_name" | grep "/$" &> /dev/null; then
note_name="${note_name}/$(generate_name)"
fi

mkdir -p "$(dirname "$notes_dir/$note_name")"

open_note "$note_name"
Expand Down

0 comments on commit 658ba00

Please sign in to comment.