From 7d8e9480ba91af55f0a225718b405f63570a465e Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Fri, 10 Mar 2023 12:11:31 -0800 Subject: [PATCH] Use trap instead of set -x This allows errors such as "command not found" to terminate the script. I considered BASH_XTRACEFD but that isn't available on bash <4.0, which is where the default bash version of macOS is tied to indefinitely. --- devel/validate-platforms | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/devel/validate-platforms b/devel/validate-platforms index ebf84038..5ae43369 100755 --- a/devel/validate-platforms +++ b/devel/validate-platforms @@ -46,8 +46,10 @@ main() { # in addition to other important software. echo "[$platform] Determining software versions..." docker-run "$platform" bash -c ' - PS4="\$ " - set -x + function echo-command { + echo "$ $BASH_COMMAND" + } + trap echo-command DEBUG nextstrain --version nextalign --version @@ -59,7 +61,7 @@ main() { dataformat version python3 -c "from importlib.metadata import version; print(version(\"phylo-treetime\"))" - ' >"$report" 2>&1 + ' >"$report" done # Compare contents of the first platform's report file against others.