Skip to content

Commit

Permalink
sytax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dineshsaini committed Aug 4, 2022
1 parent a4ccb9c commit f3d45d9
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions annote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
###############################################################################

__NAME__='annote'
__VERSION__='2.5.2'
__VERSION__='2.5.3'

# variables
c_red="$(tput setaf 196)"
Expand Down Expand Up @@ -676,7 +676,7 @@ function get_metadata {
local value=""
if $(note_exists "$nid"); then
local mfile="$notes_loc/$nid/$nid.metadata"
value="$(sed -n -e "s/^$key: //p" $mfile)"
value="$(sed -n -e "s/^$key: //p" "$mfile")"
fi
printf '%s' "$value"
}
Expand Down Expand Up @@ -745,7 +745,7 @@ function _list_prettify_fg {
local txt="$2"
local bold="$3"
if [ "x$flag_no_pretty" != "xy" ]; then
if [ $(( $c % 2 )) -eq 0 ]; then
if [ $(( c % 2 )) -eq 0 ]; then
txt="$(as_cyan "$txt")"
else
txt="$(as_light_green_2 "$txt")"
Expand All @@ -761,7 +761,7 @@ function _list_prettify_bg {
local c="$1"
local txt="$2"
if [ "x$flag_no_pretty" != "xy" ]; then
if [ $(( $c % 2 )) -eq 0 ]; then
if [ $(( c % 2 )) -eq 0 ]; then
txt="$(on_light_black "$txt")"
else
txt="$(on_dark_black "$txt")"
Expand Down Expand Up @@ -1019,8 +1019,8 @@ function list_groups {

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

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

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

if [ -n "$gpat" ]; then
while IFS= read -r line; do
line="${line#$groups_loc/}"
line="${line#"$groups_loc"/}"
line="${line%/}"
groups="$groups,${line////.}"
done < <(find "$groups_loc" -mindepth 1 -type d \
Expand Down Expand Up @@ -1560,7 +1560,6 @@ function find_notes {
shopt -q nocasematch || shopt -s nocasematch
for n in ${notes//,/ }; do
local nt="$(get_note_tags "$n")"
local f=""
for t in ${find_with_tags//,/ }; do
if [[ ,$nt, =~ ,.*$t.*, ]]; then
tnotes="$tnotes,$n"
Expand Down

0 comments on commit f3d45d9

Please # to comment.