guix: warn if running guix-build as root
authortobtoht <tob@featherwallet.org>
Wed, 9 Apr 2025 04:17:41 +0000 (06:17 +0200)
committertobtoht <tob@featherwallet.org>
Wed, 9 Apr 2025 04:17:41 +0000 (06:17 +0200)
contrib/guix/guix-build

index 31f95471b2b8100dc9ea51536d1014ab6996e530..d7a78bbbc0118e9b09a4d5eae6f34aebb4641743 100755 (executable)
@@ -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
 ################