File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ ls_notes() {
31
31
}
32
32
33
33
find_notes () {
34
- find_output=$( find " $notes_dir " -ipath " $notes_dir /*$* *" -type f 2>&1 )
35
- find_result=$?
36
- formatted_output=$( printf " $find_output " | without_notes_dir)
34
+ local find_output=$( find " $notes_dir " -ipath " $notes_dir /*$* *" -type f 2>&1 )
35
+ local find_result=$?
36
+ local formatted_output=$( printf " $find_output " | without_notes_dir)
37
37
38
38
if [[ $find_result == 0 && " $formatted_output " ]]; then
39
39
printf " $formatted_output \n"
@@ -49,9 +49,9 @@ grep_notes() {
49
49
return 1
50
50
fi
51
51
52
- grep_output=$( grep -r " $notes_dir " -li -e " $* " 2>&1 )
53
- grep_result=$?
54
- formatted_output=$( printf " $grep_output " | without_notes_dir)
52
+ local grep_output=$( grep -r " $notes_dir " -li -e " $* " 2>&1 )
53
+ local grep_result=$?
54
+ local formatted_output=$( printf " $grep_output " | without_notes_dir)
55
55
56
56
if [[ $grep_result == 0 && " $formatted_output " ]]; then
57
57
printf " $formatted_output \n"
@@ -62,7 +62,7 @@ grep_notes() {
62
62
}
63
63
64
64
new_note () {
65
- note_name=" $* "
65
+ local note_name=" $* "
66
66
mkdir -p " $( dirname " $notes_dir /$note_name " ) "
67
67
open_note " $note_name .md"
68
68
}
@@ -97,7 +97,7 @@ open_something() {
97
97
}
98
98
99
99
open_note () {
100
- note_path=$1
100
+ local note_path=$1
101
101
102
102
if [[ " $note_path " != * .md ]]; then
103
103
note_path=" $note_path .md"
136
136
}
137
137
138
138
main () {
139
- ret=0
140
- cmd=" "
139
+ local ret=0
140
+ local cmd=" "
141
141
142
142
if [ -z " $1 " ]; then
143
143
printf " No command specified\n\n"
You can’t perform that action at this time.
0 commit comments