diff --git a/install-debian.sh b/install-debian.sh index 3b9718e..db97568 100644 --- a/install-debian.sh +++ b/install-debian.sh @@ -31,12 +31,20 @@ esac echo -e "Selected hex color: $PRIMARY_COLOR\n" -# --- 1. Update and install dependencies --- echo -n "📦 Checking and installing dependencies... " -if sudo apt install -y git curl lsd micro zoxide fzf > /dev/null 2>&1; then + +# Define the command: Use sudo only if NOT root +if [ "$EUID" -ne 0 ]; then + CMD="sudo apt install -y" +else + CMD="apt install -y" +fi + +# Execute the command +if $CMD git curl lsd micro zoxide fzf > /dev/null 2>&1; then echo "Done." else - echo "Failed! Check your internet connection." + echo "Failed! Check your internet connection or package manager state." exit 1 fi