Skip to content

run_qemu.sh: use the { main; exit "$?"; } trick to allow modifications #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion run_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ exit_handler()
exit "$err"
}

# Silence SC2317 and SC2329
# https://github.com/koalaman/shellcheck/issues/2542
false && exit_handler "$@"

# Runs a command repeatedly until it succeeds. Returns true as soon as the command returns
# true before the timeout. Otherwise returns false and prints a timeout message.
Expand Down Expand Up @@ -2055,4 +2058,9 @@ main()
fi
}

main
# This compound statement { } forces bash to read it entirely before
# running it. This allows modifying the script while it's running.
# https://hachyderm.io/@simontatham/114511220670677410
{
main; exit $?
}