aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@verizonmedia.com>2020-12-21 14:37:30 +0100
committerArnstein Ressem <aressem@verizonmedia.com>2020-12-21 14:37:30 +0100
commitf7d51eb424b9d5beb54e2e9970fab9505dc8d883 (patch)
treede439ad35140b39c206549b8b78e1bd065fc0f78 /travis
parent3b021b169f7836efd215e7c4bc0302715b3e56cc (diff)
Check if script is sourced. Use return in sourced script.
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/detect-what-to-build.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/travis/detect-what-to-build.sh b/travis/detect-what-to-build.sh
index 42aaec3a43b..12bf892d419 100755
--- a/travis/detect-what-to-build.sh
+++ b/travis/detect-what-to-build.sh
@@ -1,8 +1,13 @@
#!/bin/bash
+if (( ${#BASH_SOURCE[@]} == 1 )); then
+ echo "This script must be sourced."
+ exit 1
+fi
+
if [[ $TRAVIS_PULL_REQUEST == false ]]; then
export SHOULD_BUILD=all
- exit 0
+ return 0
fi
# Future use