From a64761d4ecc9654709baa7fe9dc5e90ed8ccb2bc Mon Sep 17 00:00:00 2001 From: Jim Richter Date: Fri, 29 Jan 2021 14:25:45 +0100 Subject: [PATCH] feat: add folder creation to fx --- configs/zsh/functions/fx.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configs/zsh/functions/fx.zsh b/configs/zsh/functions/fx.zsh index 7729f55..ac0cdd8 100644 --- a/configs/zsh/functions/fx.zsh +++ b/configs/zsh/functions/fx.zsh @@ -1,7 +1,18 @@ # Helps navigating Sync directory function fx(){ + cd $HOME/SYNC/ + if [ ! -d $2 ]; then + echo "dir $2 does not exists" + if read -q '?Do you want to create it (y/n)?'; then + mkdir $2 + else + echo -e "\nalllrighty then, byyye" + return + fi + fi + if [ "$2" != "" ]; then cd $2 fi