Skip to content

Commit f3d45d9

Browse files
committed
sytax fixes
1 parent a4ccb9c commit f3d45d9

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

annote.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
###############################################################################
66

77
__NAME__='annote'
8-
__VERSION__='2.5.2'
8+
__VERSION__='2.5.3'
99

1010
# variables
1111
c_red="$(tput setaf 196)"
@@ -676,7 +676,7 @@ function get_metadata {
676676
local value=""
677677
if $(note_exists "$nid"); then
678678
local mfile="$notes_loc/$nid/$nid.metadata"
679-
value="$(sed -n -e "s/^$key: //p" $mfile)"
679+
value="$(sed -n -e "s/^$key: //p" "$mfile")"
680680
fi
681681
printf '%s' "$value"
682682
}
@@ -745,7 +745,7 @@ function _list_prettify_fg {
745745
local txt="$2"
746746
local bold="$3"
747747
if [ "x$flag_no_pretty" != "xy" ]; then
748-
if [ $(( $c % 2 )) -eq 0 ]; then
748+
if [ $(( c % 2 )) -eq 0 ]; then
749749
txt="$(as_cyan "$txt")"
750750
else
751751
txt="$(as_light_green_2 "$txt")"
@@ -761,7 +761,7 @@ function _list_prettify_bg {
761761
local c="$1"
762762
local txt="$2"
763763
if [ "x$flag_no_pretty" != "xy" ]; then
764-
if [ $(( $c % 2 )) -eq 0 ]; then
764+
if [ $(( c % 2 )) -eq 0 ]; then
765765
txt="$(on_light_black "$txt")"
766766
else
767767
txt="$(on_dark_black "$txt")"
@@ -1019,8 +1019,8 @@ function list_groups {
10191019

10201020
if [ -z "$groups" ]; then
10211021
while IFS= read -r line; do
1022-
line="${line#$gl/}"
1023-
$groups="$groups,${line////.}"
1022+
line="${line#"$gl"/}"
1023+
groups="$groups,${line////.}"
10241024
done < <(find "$gl" -type f -name 'notes.lnk' -printf '%h\n')
10251025
groups="${groups#,}"
10261026
else
@@ -1069,7 +1069,7 @@ function list_tags {
10691069

10701070
if [ -z "$tags" ]; then
10711071
while IFS= read -r line; do
1072-
$tags="$tags,${line#$tags_loc/}"
1072+
tags="$tags,${line#"$tags_loc"/}"
10731073
done < <(find "$tags_loc" -mindepth 1 -maxdepth 2 -type f \
10741074
-name 'notes.lnk' -printf '%h\n')
10751075
tags="${tags#,}"
@@ -1403,7 +1403,7 @@ function get_subgroups {
14031403
gl="${gl%/}"
14041404

14051405
while IFS= read -r line; do
1406-
line="${line#$groups_loc/}"
1406+
line="${line#"$groups_loc"/}"
14071407
sgrps="$sgrps,${line////.}"
14081408
done < <(find "$gl" -mindepth 2 -type f -name 'notes.lnk' -printf '%h\n')
14091409
sgrps="${sgrps#,}"
@@ -1467,7 +1467,7 @@ function find_groups {
14671467

14681468
if [ -n "$gpat" ]; then
14691469
while IFS= read -r line; do
1470-
line="${line#$groups_loc/}"
1470+
line="${line#"$groups_loc"/}"
14711471
line="${line%/}"
14721472
groups="$groups,${line////.}"
14731473
done < <(find "$groups_loc" -mindepth 1 -type d \
@@ -1560,7 +1560,6 @@ function find_notes {
15601560
shopt -q nocasematch || shopt -s nocasematch
15611561
for n in ${notes//,/ }; do
15621562
local nt="$(get_note_tags "$n")"
1563-
local f=""
15641563
for t in ${find_with_tags//,/ }; do
15651564
if [[ ,$nt, =~ ,.*$t.*, ]]; then
15661565
tnotes="$tnotes,$n"

0 commit comments

Comments
 (0)