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.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy