From 55c6db1b1296025189fea4ae44cfa913b5c7e2f8 Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Sat, 14 Sep 2024 08:07:22 -0400 Subject: [PATCH] Implement dir checking logic --- tabs/applications-setup/mybash-setup.sh | 4 ++++ tabs/applications-setup/neovim-setup.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tabs/applications-setup/mybash-setup.sh b/tabs/applications-setup/mybash-setup.sh index 41460bcf..a258afc4 100644 --- a/tabs/applications-setup/mybash-setup.sh +++ b/tabs/applications-setup/mybash-setup.sh @@ -5,6 +5,10 @@ gitpath="$HOME/.local/share/mybash" cloneMyBash() { + # Check if the dir exists before attempting to clone into it. + if [ -d "$gitpath" ]; then + rm -rf "$gitpath" + fi mkdir -p "$HOME/.local/share" # Only create the dir if it doesn't exist. cd "$HOME" && git clone https://github.com/ChrisTitusTech/mybash.git "$gitpath" } diff --git a/tabs/applications-setup/neovim-setup.sh b/tabs/applications-setup/neovim-setup.sh index b1bfaa6b..f8788903 100755 --- a/tabs/applications-setup/neovim-setup.sh +++ b/tabs/applications-setup/neovim-setup.sh @@ -5,6 +5,10 @@ gitpath="$HOME/.local/share/neovim" cloneNeovim() { + # Check if the dir exists before attempting to clone into it. + if [ -d "$gitpath" ]; then + rm -rf "$gitpath" + fi mkdir -p "$HOME/.local/share" # Only create the dir if it doesn't exist. cd "$HOME" && git clone https://github.com/ChrisTitusTech/neovim.git "$HOME/.local/share/neovim" }