Skip to content

Commit 381b32a

Browse files
committed
Allow subfolders with spaces
1 parent 32395e9 commit 381b32a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

notes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ grep_notes() {
4646

4747
new_note() {
4848
note_name="$*"
49-
mkdir -p $(dirname "$notes_dir/$note_name")
49+
mkdir -p "$(dirname "$notes_dir/$note_name")"
5050
open_note "$note_name.md"
5151
}
5252

@@ -154,7 +154,7 @@ main() {
154154
esac
155155
shift
156156

157-
$cmd $@
157+
$cmd "$@"
158158
ret=$[$ret+$?]
159159
exit $ret
160160
}

test/test-new.bats

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,11 @@ notes="./notes"
4141

4242
assert_success
4343
assert_exists "$NOTES_DIRECTORY/note with spaces.md"
44-
}
44+
}
45+
46+
@test "Should create notes within subfolders with spaces" {
47+
run $notes new "subfolder with spaces/note"
48+
49+
assert_success
50+
assert_exists "$NOTES_DIRECTORY/subfolder with spaces/note.md"
51+
}

0 commit comments

Comments
 (0)