From dc4d7c9dbfc7560819d325d37979bce3e9f53798 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 9 Apr 2025 06:17:41 +0200 Subject: [PATCH] guix: warn if running guix-build as root --- contrib/guix/guix-build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build index 31f95471..d7a78bbb 100755 --- a/contrib/guix/guix-build +++ b/contrib/guix/guix-build @@ -19,6 +19,15 @@ source "$(dirname "${BASH_SOURCE[0]}")/libexec/prelude.bash" check_tools cat mkdir make getent curl git guix +################ +# Check if we're running as root +################ + +if [ "$EUID" -eq 0 ]; then + echo "Warning! Running this script as root may cause problems." + echo +fi + ################ # GUIX_BUILD_OPTIONS should be empty ################ -- 2.52.0