diff --git a/tools/tf_env_collect.sh b/tools/tf_env_collect.sh index b7b8c25ee43..a1c9c88c58c 100755 --- a/tools/tf_env_collect.sh +++ b/tools/tf_env_collect.sh @@ -16,10 +16,20 @@ set -u # Check for undefined variables +die() { + # Print a message and exit with code 1. + # + # Usage: die + # e.g., die "Something bad happened." + + echo $@ + exit 1 +} + echo "Collecting system information..." OUTPUT_FILE=tf_env.txt -python_bin_path=$(which python || which python3 || true) +python_bin_path=$(which python || which python3 || die "Cannot find Python binary") { echo