From 0d2f6918322c7bf29d1de3075b0d4ed3b1b72919 Mon Sep 17 00:00:00 2001 From: Androbin Date: Thu, 15 Jun 2017 00:01:39 +0200 Subject: [PATCH] Create tf_env_collect.sh --- tools/tf_env_collect.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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