summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-05-25 16:34:07 +0100
committerLeah Rowe <leah@libreboot.org>2024-05-25 16:34:07 +0100
commit8d199a31d1bffb3d23b126965c331fe640fc5e73 (patch)
tree1eca8fe887ed8a9d67a94b76003b0491681f9667
parent8da2559b35d576ad13806e61a590ad3a8de26cda (diff)
build: simplify git checks
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xbuild11
1 files changed, 4 insertions, 7 deletions
diff --git a/build b/build
index d70b44ff..cf18d25e 100755
--- a/build
+++ b/build
@@ -30,13 +30,10 @@ main()
[ "$1" = "dependencies" ] && x_ install_packages $@ && return 0
- which git 1>/dev/null 2>/dev/null || \
- git_err "git not installed. please install git-scm."
- git config --global user.name 1>/dev/null 2>/dev/null || \
- git_err "git config --global user.name \"John Doe\""
- git config --global user.email 1>/dev/null 2>/dev/null || \
- git_err "git config --global user.email \"john.doe@example.com\""
- git_init
+ 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"