Make rerun() more robust if curl is unavailable

This commit is contained in:
2026-07-30 16:49:46 -04:00
parent 4b2305e637
commit 2c5a59bbac

View File

@@ -2268,8 +2268,12 @@ rerun() {
debug "${FUNCNAME[0]}()" "$@" debug "${FUNCNAME[0]}()" "$@"
if ((SCRIPT_IS_PIPED)); then if ((SCRIPT_IS_PIPED)); then
# Re-download and execute if script was piped # Re-download and execute if script was piped
curl -fsSL "$SCRIPT_URL" | bash -s -- "$@" "--no-update" if command -v curl &>/dev/null || install_package curl; then
exit $? curl -fsSL "$SCRIPT_URL" | bash -s -- "$@" "--no-update"
else
bash -s -- "$@" "--no-update"
fi
exit $? # exit parent script with same exit code
else else
exec bash "$SCRIPT_PATH" "$@" "--no-update" exec bash "$SCRIPT_PATH" "$@" "--no-update"
fi fi