fixes in behavior when selecting directories

This commit is contained in:
Jakub Nawalaniec 2023-04-09 11:54:38 +02:00
parent cdbe2ee963
commit b2797555a8
1 changed files with 7 additions and 3 deletions

View File

@ -15,10 +15,14 @@ printf "find: "
read -r pattern
if type plocate >/dev/null 2>&1; then
dest_path=$(plocate $pattern | fzf)
dest_path=$(plocate "$pattern" | fzf)
else
dest_path=$(locate $pattern | fzf)
dest_path=$(locate "$pattern" | fzf)
fi
dest_dir=$(dirname "$dest_path")
if [[ -f "$dest_path" ]]; then
dest_dir=$(dirname "$dest_path")
else
dest_dir="$dest_path"
fi
nnn_cd "$dest_dir" 0