From f6778dec14dc37bb27a3bf71b7c5a8c42a77d7a5 Mon Sep 17 00:00:00 2001 From: Max Weiss Date: Wed, 28 Apr 2021 22:14:33 -0700 Subject: [PATCH] Enabled buildbot_steps script to be sourced or ran directly by bash --- buildbot/buildbot_steps.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/buildbot/buildbot_steps.sh b/buildbot/buildbot_steps.sh index 46102d1..099ae70 100755 --- a/buildbot/buildbot_steps.sh +++ b/buildbot/buildbot_steps.sh @@ -480,3 +480,12 @@ function upload_release_ipxe_shasums() { return 0 } + +if [[ ! "$(ps -o cmd -p $$ | tail -n 1 | tr -d '\n')" =~ "bash" ]]; then + >&2 echo "Shell not bash, exiting." + exit 1 +fi + +# This is a bash-specific hack to determine if the file is being sourced or +# run as a script. It will only work in bash, not other shells. +(return 0 2>/dev/null) || "$@"