root check

This commit is contained in:
2026-05-01 15:05:47 +01:00
parent 5e3cb44e97
commit 7fabfa4bca
+11 -3
View File
@@ -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