summaryrefslogtreecommitdiffstats
path: root/scripts/setup-environment.sh
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@theqtcompany.com>2016-03-29 12:40:14 -0700
committerSamuli Piippo <samuli.piippo@theqtcompany.com>2016-04-08 06:06:17 +0000
commit04d4e351cde51a61e9ceaeb0265c1d4b8677b6ca (patch)
tree7f9aeb71d4d6432b3293ac7bfa04ac398b4ad677 /scripts/setup-environment.sh
parent3fc7fbeb76fb97ceae6763e6dccebbaa9c14c5f4 (diff)
downloadmeta-boot2qt-04d4e351cde51a61e9ceaeb0265c1d4b8677b6ca.tar.gz
setup-environment: prevent basename argument being parsed as option.
This fixes an issue where this script fails with the default Dash shell on Ubuntu (where "$0" is "-bash" and it is parsed as an option). Change-Id: I6fec2a7b4e8eee68b5f11101783d7dff7d07f712 Reviewed-by: Donald Carr <donald.carr@theqtcompany.com> Reviewed-by: Risto Avila <risto.avila@theqtcompany.com> Reviewed-by: Samuli Piippo <samuli.piippo@theqtcompany.com>
Diffstat (limited to 'scripts/setup-environment.sh')
-rwxr-xr-xscripts/setup-environment.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/setup-environment.sh b/scripts/setup-environment.sh
index 28adeec..566b708 100755
--- a/scripts/setup-environment.sh
+++ b/scripts/setup-environment.sh
@@ -34,7 +34,7 @@ while test -n "$1"; do
34done 34done
35 35
36THIS_SCRIPT="setup-environment.sh" 36THIS_SCRIPT="setup-environment.sh"
37if [ "$(basename $0)" = "${THIS_SCRIPT}" ]; then 37if [ "$(basename -- $0)" = "${THIS_SCRIPT}" ]; then
38 echo "Error: This script needs to be sourced. Please run as '. $0'" 38 echo "Error: This script needs to be sourced. Please run as '. $0'"
39 exit 1 39 exit 1
40fi 40fi