mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
Meta: Use common method exit_if_running_as_root() in serenity.sh
This replaces the inline check for running as root with the common method exit_if_running_as_root().
This commit is contained in:
parent
b4a0fee03d
commit
9ef3704ce8
Notes:
sideshowbarker
2024-07-17 00:23:42 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/9ef3704ce8 Pull-request: https://github.com/SerenityOS/serenity/pull/18495 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/fdellwing
@ -66,11 +66,6 @@ Usage: $NAME COMMAND [TARGET] [TOOLCHAIN] [ARGS...]
|
||||
EOF
|
||||
}
|
||||
|
||||
die() {
|
||||
>&2 echo "die: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage() {
|
||||
>&2 print_help
|
||||
exit 1
|
||||
@ -84,9 +79,12 @@ if [ "$CMD" = "help" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
die "Do not run serenity.sh as root, your Build directory will become root-owned"
|
||||
fi
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
. "${DIR}/shell_include.sh"
|
||||
|
||||
exit_if_running_as_root "Do not run serenity.sh as root, your Build directory will become root-owned"
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
TARGET="$1"; shift
|
||||
|
Loading…
Reference in New Issue
Block a user