Skip to content

Commit c2f0f1e

Browse files
committed
nixos-anywhere: fix Bash quitting before throwing proper error message
1 parent 9cd1721 commit c2f0f1e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/nixos-anywhere.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,14 @@ importFacts() {
525525
# shellcheck disable=SC2046
526526
export $(echo "$filteredFacts" | xargs)
527527

528+
# Necessary to prevent Bash erroring before printing out which fact had an issue
529+
set +u
528530
for var in isOs isArch isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid; do
529531
if [[ -z ${!var} ]]; then
530532
abort "Failed to retrieve fact $var from host"
531533
fi
532534
done
535+
set -u
533536
}
534537

535538
checkBuildLocally() {

0 commit comments

Comments
 (0)