Skip to content

Commit

Permalink
meta: Don't use sudo if we are alread root.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Jan 22, 2025
1 parent 2f21a2b commit dbac81f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions ck
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ function is_arch() {
return 1
}

if [ "$EUID" -eq 0 ]; then
export CUTEKIT_ELEVATOR=""
elif [ -z "$CUTEKIT_ELEVATOR" ]; then
export CUTEKIT_ELEVATOR="sudo"
fi

if [ -z "$CUTEKIT_PYTHON" ]; then
if command -v python3.11 &> /dev/null; then
export CUTEKIT_PYTHON="python3.11"
Expand Down Expand Up @@ -72,10 +78,10 @@ if [ ! -f .cutekit/tools-ready ]; then

if is_ubuntu; then
echo "Detected Ubuntu, installing dependencies automatically..."
sudo ./meta/scripts/setup-ubuntu.sh
$CUTEKIT_ELEVATOR ./meta/scripts/setup-ubuntu.sh
elif is_arch; then
echo "Detected Arch Linux, installing dependencies automatically..."
sudo ./meta/scripts/setup-arch.sh
$CUTEKIT_ELEVATOR ./meta/scripts/setup-arch.sh
elif is_darwin; then
echo "Detected macOS, installing dependencies automatically..."
./meta/scripts/setup-darwin.sh
Expand Down
2 changes: 1 addition & 1 deletion meta/scripts/setup-arch.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

sudo pacman -S base-devel git ninja extra/llvm sdl2 nasm gcc-multilib qemu-system-x86 liburing clang
pacman -S base-devel git ninja extra/llvm sdl2 nasm gcc-multilib qemu-system-x86 liburing clang

0 comments on commit dbac81f

Please sign in to comment.