Skip to content

Commit 55c6db1

Browse files
author
nnyyxxxx
committed
Implement dir checking logic
1 parent 8ed2265 commit 55c6db1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tabs/applications-setup/mybash-setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
gitpath="$HOME/.local/share/mybash"
66

77
cloneMyBash() {
8+
# Check if the dir exists before attempting to clone into it.
9+
if [ -d "$gitpath" ]; then
10+
rm -rf "$gitpath"
11+
fi
812
mkdir -p "$HOME/.local/share" # Only create the dir if it doesn't exist.
913
cd "$HOME" && git clone https://github.com/ChrisTitusTech/mybash.git "$gitpath"
1014
}

tabs/applications-setup/neovim-setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
gitpath="$HOME/.local/share/neovim"
66

77
cloneNeovim() {
8+
# Check if the dir exists before attempting to clone into it.
9+
if [ -d "$gitpath" ]; then
10+
rm -rf "$gitpath"
11+
fi
812
mkdir -p "$HOME/.local/share" # Only create the dir if it doesn't exist.
913
cd "$HOME" && git clone https://github.com/ChrisTitusTech/neovim.git "$HOME/.local/share/neovim"
1014
}

0 commit comments

Comments
 (0)