Add check whether ~/Containers exists

This commit is contained in:
Thomas Avé 2024-02-21 16:29:43 +01:00
parent 8a5df9ee7f
commit fe95457735
1 changed files with 6 additions and 1 deletions

View File

@ -90,7 +90,12 @@ function zvm_after_init() {
# Use FZY instead of FZF for ctrl-t
function find_files() {
zle -I
BUFFER=cd "$(fd -H . ~/Workspace ~/Containers -t d | fzy -l 20)"
# Check if ~/Containers exists
if [ -d ~/Containers ]; then
BUFFER=cd "$(fd -H . ~/Workspace ~/Containers -t d | fzy -l 20)"
else
BUFFER=cd "$(fd -H . ~/Workspace -t d | fzy -l 20)"
fi
zle accept-line
clear
}