Skip to content

Commit

Permalink
task: add condition for ci use and add user prompt for install.sh no …
Browse files Browse the repository at this point in the history
…root warning
  • Loading branch information
LvckyAPI committed May 21, 2024
1 parent 913f79c commit 7ad18eb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ if [[ -n "$MSYSTEM" ]]; then
fi

# Check if script was executed with root/sudo
if [ `id -u` -ne 0 ]
then echo Please run this script as root or using sudo!
exit
if [ "$(id -u)" -ne 0 ]; then
if [ "$CI" != "true" ]; then
echo "You should be using sudo, are you sure you want to continue? [y/n]"
read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo "Continuing without sudo. This might cause issues later on."
else
echo "The script execution was stopped. Please run it again with sudo."
exit
fi
fi
fi


source install/_lib.sh

# Pre-flight. No impact yet.
Expand Down

0 comments on commit 7ad18eb

Please sign in to comment.