#!/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