We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c62c70 commit 1324b1bCopy full SHA for 1324b1b
notes
@@ -85,8 +85,23 @@ grep_notes() {
85
fi
86
}
87
88
+generate_name() {
89
+ local append_num=0
90
+ local format_string="`date +$QUICKNOTE_FORMAT`"
91
+ # Initial test has no append
92
+ resolved_name=$format_string
93
+ while [[ -e "$notes_dir/$resolved_name$file_ext" ]]; do
94
+ append_num=$[$append_num+1]
95
+ resolved_name=$format_string.$append_num
96
+ done
97
+}
98
+
99
new_note() {
100
local note_name="$*"
101
+ if [[ $note_name == "" ]]; then
102
+ generate_name
103
+ note_name=$resolved_name
104
+ fi
105
mkdir -p "$(dirname "$notes_dir/$note_name")"
106
open_note "$note_name$file_ext"
107
0 commit comments