Skip to content

Commit

Permalink
Use trap instead of set -x
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
victorlin committed Mar 10, 2023
1 parent 116ff52 commit 7d8e948
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions devel/validate-platforms
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 7d8e948

Please sign in to comment.