From fe954577356112ab49104879ccbb590bc971a828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 21 Feb 2024 16:29:43 +0100 Subject: [PATCH] Add check whether ~/Containers exists --- zsh/.zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index fc26d97..12f2e02 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -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 }