diff --git a/colorscript.sh b/colorscript.sh index 5674c6a..b3c0d21 100644 --- a/colorscript.sh +++ b/colorscript.sh @@ -53,13 +53,14 @@ fi clone() { local cloneDir="/opt/shell-color-scripts" if [ ! -d "$cloneDir" ]; then - $_sudo git clone --depth=1 https://github.com/charitarthchugh/shell-color-scripts "$cloneDir" + $_sudo git clone --depth=1 https://github.com/charitarthchugh/shell-color-scripts "$cloneDir" && + $_sudo chmod +x "$cloneDir/colorscript.sh" fi } link() { if [ -d "$HOME/.local/bin" ]; then - ln -sfr /opt/shell-color-scripts/colorscript.sh "$HOME/.local/bin/colorscript" + $_sudo ln -sfr /opt/shell-color-scripts/colorscript.sh "$HOME/.local/bin/colorscript" || echo_error "Could not link the script" else if check_root; then $_sudo ln -sfr /opt/shell-color-scripts/colorscript.sh /bin/colorscript @@ -69,7 +70,15 @@ link() { fi } +checkInstall() { + if command_exists colorscript; then + echo_note "Installation complete" + fi +} + check_root && if clone; then link fi + +checkInstall