mirror of
https://github.com/iridakos/goto.git
synced 2025-05-16 23:40:16 -07:00
Fix shellcheck errors and warnings.
This commit is contained in:
parent
3bb1dc79de
commit
a1c2b8a78c
@ -111,7 +111,9 @@ function _goto_list_aliases()
|
|||||||
|
|
||||||
function _goto_find_duplicate()
|
function _goto_find_duplicate()
|
||||||
{
|
{
|
||||||
local duplicates=$(sed -n 's:[^ ]* '"$1"'$:&:p' "$GOTO_DB" 2>/dev/null)
|
local duplicates=
|
||||||
|
|
||||||
|
duplicates=$(sed -n 's:[^ ]* '"$1"'$:&:p' "$GOTO_DB" 2>/dev/null)
|
||||||
echo "$duplicates"
|
echo "$duplicates"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +145,8 @@ function _goto_register_alias()
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local duplicate=$(_goto_find_duplicate "$directory")
|
local duplicate
|
||||||
|
duplicate=$(_goto_find_duplicate "$directory")
|
||||||
|
|
||||||
# Append entry to file.
|
# Append entry to file.
|
||||||
echo "$1 $directory" >> "$GOTO_DB"
|
echo "$1 $directory" >> "$GOTO_DB"
|
||||||
@ -170,6 +173,7 @@ function _goto_unregister_alias
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034
|
||||||
local readonly GOTO_DB_TMP="$HOME/.goto_"
|
local readonly GOTO_DB_TMP="$HOME/.goto_"
|
||||||
# Delete entry from file.
|
# Delete entry from file.
|
||||||
sed "/^$1 /d" "$GOTO_DB" > "$GOTO_DB_TMP" && mv "$GOTO_DB_TMP" "$GOTO_DB"
|
sed "/^$1 /d" "$GOTO_DB" > "$GOTO_DB_TMP" && mv "$GOTO_DB_TMP" "$GOTO_DB"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user