diff options
author | Arnstein Ressem <aressem@verizonmedia.com> | 2020-12-21 14:37:30 +0100 |
---|---|---|
committer | Arnstein Ressem <aressem@verizonmedia.com> | 2020-12-21 14:37:30 +0100 |
commit | f7d51eb424b9d5beb54e2e9970fab9505dc8d883 (patch) | |
tree | de439ad35140b39c206549b8b78e1bd065fc0f78 /travis/detect-what-to-build.sh | |
parent | 3b021b169f7836efd215e7c4bc0302715b3e56cc (diff) |
Check if script is sourced. Use return in sourced script.
Diffstat (limited to 'travis/detect-what-to-build.sh')
-rwxr-xr-x | travis/detect-what-to-build.sh | 7 |
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 |