Skip to content

Commit 1324b1b

Browse files
committed
Add Quicknotes
1 parent 0c62c70 commit 1324b1b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

notes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,23 @@ grep_notes() {
8585
fi
8686
}
8787

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+
8899
new_note() {
89100
local note_name="$*"
101+
if [[ $note_name == "" ]]; then
102+
generate_name
103+
note_name=$resolved_name
104+
fi
90105
mkdir -p "$(dirname "$notes_dir/$note_name")"
91106
open_note "$note_name$file_ext"
92107
}

0 commit comments

Comments
 (0)