This commit is contained in:
Lucas F 2022-11-21 09:57:03 -03:00
parent 18ecc8a783
commit 027e525fa7
6 changed files with 301 additions and 2 deletions

27
install.sh Normal file
View file

@ -0,0 +1,27 @@
#!/bin/sh
main() {
local ROCKDIR="$HOME/.local/share/rock"
local ZSHRC="$HOME/.zshrc"
local CMD='[[ -f "$HOME/.local/share/rock/rock.zsh" ]] && source "$HOME/.local/share/rock/rock.zsh"'
git clone https://git.lucasf.dev/public/rock "$ROCKDIR" > /dev/null 2>&1
if [[ ! -d "$ROCKDIR/plugins" ]]; then
mkdir -p "$ROCKDIR/plugins"
fi
if [[ -n "$ZDOTDIR" ]] && [[ -f "$ZDOTDIR/.zshrc" ]]; then
ZSHRC="$ZDOTDIR/.zshrc"
fi
if [[ ! -f $ZSHRC || $(cat $ZSHRC | wc -l) = 0 ]];then
echo $CMD > $ZSHRC
else
if ! grep -q '[[ -f "$HOME/.local/share/rock/rock.zsh" ]] && source "$HOME/.local/share/rock/rock.zsh"' $ZSHRC; then
sed -i '1 i[[ -f "$HOME/.local/share/rock/rock.zsh" ]] && source "$HOME/.local/share/rock/rock.zsh"' $ZSHRC
fi
fi
}
main
if [[ $? -eq 0 ]];then echo "🎸 You Rock Yeah!! 🤘"; fi
# vim: ft=zsh:ts=4:sts=4:sw=4