summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-05-25 16:34:48 +0100
committerLeah Rowe <leah@libreboot.org>2024-05-25 16:34:48 +0100
commitdb06bbdb6e4b60d710f5cabe7b637d4737726119 (patch)
tree5e430a0f3e0edc1a564753af6efb3262691da46a /build
parent8d199a31d1bffb3d23b126965c331fe640fc5e73 (diff)
build: do root check before git check
otherwise, git could be initialised as root. running as root is not allowed. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'build')
-rwxr-xr-xbuild4
1 files changed, 2 insertions, 2 deletions
diff --git a/build b/build
index cf18d25e..72318241 100755
--- a/build
+++ b/build
@@ -30,13 +30,13 @@ main()
[ "$1" = "dependencies" ] && x_ install_packages $@ && return 0
+ [ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
+
for g in "which git" "git config --global user.name" \
"git config --global user.email" "git_init"; do
eval "$g 1>/dev/null 2>/dev/null || git_err \"$g\""
done
- [ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
-
case "${1}" in
version) printf "%s\n" "$relname" ;;
release) shift 1; mkrelease $@ ;;