Use if statement instead of curly braces in _forgit_ignore

This commit is contained in:
sandroid 2024-03-28 21:29:18 +01:00
parent b099a40bc1
commit 685d21bee2
No known key found for this signature in database
GPG key ID: 91418C9982B8B76E

View file

@ -875,13 +875,14 @@ _forgit_ignore() {
$FORGIT_IGNORE_FZF_OPTS
"
# shellcheck disable=SC2206
args=($@) && [[ $# -eq 0 ]] && {
args=($@)
if [[ $# -eq 0 ]]; then
args=()
while IFS='' read -r arg; do
args+=("$arg")
done < <(_forgit_ignore_list | nl -w4 -s' ' |
FZF_DEFAULT_OPTS="$opts" fzf | awk '{print $2}')
}
fi
[ ${#args[@]} -eq 0 ] && return 1
# shellcheck disable=SC2068
_forgit_ignore_get ${args[@]}