plugins/fzcd | 6 ++---- diff --git a/plugins/fzcd b/plugins/fzcd index b3f5efff15552ee4fe6923536166e15d117333c1..a590d966eb321c926fe76e9a20c12f443b7be3ae 100755 --- a/plugins/fzcd +++ b/plugins/fzcd @@ -14,11 +14,9 @@ exit 1 fi if [ -n "$sel" ]; then - if ! [ -d "$sel" ]; then - sel=$(dirname "$sel") - elif [ "$sel" = "." ]; then + if [ "$sel" = "." ] || (! [ -d "$sel" ] && ! [ -f "$sel" ]); then exit 0 - fi + fi # Check if selected path returned # by fzf command is absolute