config/shell/browse/d: fix switcher fallback

This commit is contained in:
xeruf 2022-06-01 01:30:29 +02:00
parent df06bc1a09
commit ef61b8f79f
1 changed files with 2 additions and 2 deletions

View File

@ -97,8 +97,8 @@ d() {
$(echo "$query" | sed 'N;s|/.* \([0-9]\)|> 10 * \1|;q' | sed 's| */.*||') >/dev/null #2>&1
then echo "$query" | head -1
else test -n "$query" && echo "$query"; locate-zox "$@"
fi | zoxide-fzf)" &&
test -z "$target" && sudo updatedb && target="$(locate --basename "$@" | fzf-dir)"
fi | zoxide-fzf)"
test $? -lt 2 && test -z "$target" && sudo updatedb && target="$(locate --basename "$@" | fzf-dir)"
test -n "$target" && cd "$target"
}
# Switch directory interactively using zoxide and locate