error fixes

This commit is contained in:
pika 2025-05-04 19:15:28 +02:00
parent fc6025d0ae
commit 951ed75144

View file

@ -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