Skip to content

Commit

Permalink
Make new understand subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Nov 30, 2016
1 parent 59e3fef commit 4d7d2c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion notes
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ grep_notes() {
}

new_note() {
$EDITOR $notes_dir/$1.md
note_path=$notes_dir/$1.md
mkdir -p $(dirname $note_path)
$EDITOR $note_path
}

usage() {
Expand Down
7 changes: 7 additions & 0 deletions test/test-new.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ notes="./notes"

assert_success
assert_exists "$NOTES_DIRECTORY/note.md"
}

@test "Should create new notes within subfolders" {
run $notes new subfolder/note

assert_success
assert_exists "$NOTES_DIRECTORY/subfolder/note.md"
}

0 comments on commit 4d7d2c7

Please sign in to comment.