mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 13:22:28 +00:00
Implement dir checking logic
This commit is contained in:
parent
8ed2265463
commit
55c6db1b12
|
@ -5,6 +5,10 @@
|
||||||
gitpath="$HOME/.local/share/mybash"
|
gitpath="$HOME/.local/share/mybash"
|
||||||
|
|
||||||
cloneMyBash() {
|
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.
|
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"
|
cd "$HOME" && git clone https://github.com/ChrisTitusTech/mybash.git "$gitpath"
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
gitpath="$HOME/.local/share/neovim"
|
gitpath="$HOME/.local/share/neovim"
|
||||||
|
|
||||||
cloneNeovim() {
|
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.
|
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"
|
cd "$HOME" && git clone https://github.com/ChrisTitusTech/neovim.git "$HOME/.local/share/neovim"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user