aboutsummaryrefslogtreecommitdiff
path: root/custom/lib/common.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-23 18:02:52 -0600
committerCraig Jennings <c@cjennings.net>2026-01-23 18:02:52 -0600
commitc4979e8c8aec181f2b335c65823f1311815777f5 (patch)
treee9776b2faf63c3595e78f1ea176b67a3e4852227 /custom/lib/common.sh
parent70fe414c5f3d57567328e3a7ec8e673dccb7f1a1 (diff)
downloadarchangel-c4979e8c8aec181f2b335c65823f1311815777f5.tar.gz
archangel-c4979e8c8aec181f2b335c65823f1311815777f5.zip
Fix set -e compatibility in lib functions
- Replace [[ ]] && error pattern with if/then/fi - Pattern causes exit when condition is false with set -e - Fixed in: common.sh, config.sh, disk.sh, install-archzfs Discovered during VM testing: the && short-circuit returns exit code 1 when condition is false, triggering set -e to abort.
Diffstat (limited to 'custom/lib/common.sh')
-rw-r--r--custom/lib/common.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/custom/lib/common.sh b/custom/lib/common.sh
index a41441d..2f8844e 100644
--- a/custom/lib/common.sh
+++ b/custom/lib/common.sh
@@ -42,7 +42,9 @@ log() {
#############################
require_root() {
- [[ $EUID -ne 0 ]] && error "This script must be run as root"
+ if [[ $EUID -ne 0 ]]; then
+ error "This script must be run as root"
+ fi
}
command_exists() {