File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -174,11 +174,13 @@ get_full_note_path() {
174
174
local note_path=$1
175
175
176
176
# first check if file exists
177
- if [ -f " $note_path " ]; then # note path given is good
177
+ if [ -f " $note_path " ]; then # note path given is good absolute or relative path
178
178
note_path=" $note_path "
179
- elif [ -f " $notes_dir /$note_path " ]; then # exists
179
+ elif [ -f " $notes_dir /$note_path " ]; then # exists in notes_dir
180
180
note_path=" $notes_dir /$note_path "
181
- elif echo " $note_path " | grep ' [.][A-Za-z]\{1,4\}$' & > /dev/null; then # has a 1-4 letter extension
181
+ elif [ -f " $notes_dir /$note_path .$NOTES_EXT " ]; then # note with this name and default extension exists
182
+ note_path=" $notes_dir /$note_path .$NOTES_EXT "
183
+ elif echo " $note_path " | grep ' [.][A-Za-z]\{1,4\}$' & > /dev/null; then # given name has a 1-4 letter extension
182
184
note_path=" $notes_dir /$note_path "
183
185
else
184
186
if [[ " $note_path " != * .$NOTES_EXT ]]; then
You can’t perform that action at this time.
0 commit comments