Skip to content

Commit b879e53

Browse files
committed
comment reexec under bash
1 parent b88c6eb commit b879e53

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/dappnode_uninstall.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ if (return 0 2>/dev/null); then
66
return 1
77
fi
88

9-
# Re-exec under bash if invoked by another shell (e.g. zsh)
9+
# This uninstaller is written for bash. It's safe to *run it from zsh* (it will execute via bash
10+
# thanks to the shebang), but users sometimes invoke it as `zsh ./script.sh` or `source ./script.sh`.
11+
# - If sourced, bail out (sourcing would pollute the current shell and can break it).
12+
# - If invoked by a non-bash shell, re-exec with bash before hitting bash-specific builtins.
1013
if [ -z "${BASH_VERSION:-}" ]; then
1114
exec /usr/bin/env bash "$0" "$@"
1215
fi

0 commit comments

Comments
 (0)