aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tf_env_collect.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/tf_env_collect.sh b/tools/tf_env_collect.sh
index b7b8c25ee4..a1c9c88c58 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 <error_message>
+ # 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