mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-04-09 14:15:54 +01: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…
x
Reference in New Issue
Block a user