diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-07-03 12:43:13 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2019-07-05 12:54:17 -0700 |
commit | 5686c2a5443bb627edc60e91703bb5c78305e1f6 (patch) | |
tree | 10e6d8296bc08be9f99a80da0704959629eea5d7 /share/spack/qa/setup-env-test.sh | |
parent | 47e9f7aac9c0418fd1e31e88bd49017c429565db (diff) | |
download | spack-5686c2a5443bb627edc60e91703bb5c78305e1f6.tar.gz spack-5686c2a5443bb627edc60e91703bb5c78305e1f6.tar.bz2 spack-5686c2a5443bb627edc60e91703bb5c78305e1f6.tar.xz spack-5686c2a5443bb627edc60e91703bb5c78305e1f6.zip |
setup-env.sh: make setup scripts work with `set -u`
- Add set -u to the setup-env.sh test script
- Refactor lines in setup-env.sh that tested potentially undefined
variables to use the `[ -z ${var+x} ]` construct
Diffstat (limited to 'share/spack/qa/setup-env-test.sh')
-rwxr-xr-x | share/spack/qa/setup-env-test.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/share/spack/qa/setup-env-test.sh b/share/spack/qa/setup-env-test.sh index b75d006e75..f572166b05 100755 --- a/share/spack/qa/setup-env-test.sh +++ b/share/spack/qa/setup-env-test.sh @@ -163,6 +163,9 @@ unuse() { # Make sure no environment is active unset SPACK_ENV +# fail with undefined variables +set -u + # Source setup-env.sh before tests . share/spack/setup-env.sh |