summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2018-07-10 10:54:55 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2018-07-24 11:27:17 -0700
commit443d702971be3ce7fa203348cb3eae16b55e0909 (patch)
tree2d169278c4fea2ad2ff55dc9b01d5e290b39ecf7 /share
parentc0d9de240ae49c3e5dccfdefbfcecfc4574cd539 (diff)
downloadspack-443d702971be3ce7fa203348cb3eae16b55e0909.tar.gz
spack-443d702971be3ce7fa203348cb3eae16b55e0909.tar.bz2
spack-443d702971be3ce7fa203348cb3eae16b55e0909.tar.xz
spack-443d702971be3ce7fa203348cb3eae16b55e0909.zip
spack load exits with 1 if module does not exist or is not installed
fixes #2215 fixes #2570 fixes #6676 fixes #7281 closes #3827 This PR reverts the use of `spack module loads` in favor of `spack module find` when loading module files via Spack. After this PR `spack load` will accept a single spec at a time, and will be able to interpret correctly the `--dependencies` option.
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/setup-env.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 5774e8f762..6e5ab2b897 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -123,18 +123,26 @@ function spack {
"use")
if _sp_full_spec=$(command spack $_sp_flags dotkit find $_sp_subcommand_args "${_sp_spec[@]}"); then
use $_sp_module_args $_sp_full_spec
+ else
+ $(exit 1)
fi ;;
"unuse")
if _sp_full_spec=$(command spack $_sp_flags dotkit find $_sp_subcommand_args "${_sp_spec[@]}"); then
unuse $_sp_module_args $_sp_full_spec
+ else
+ $(exit 1)
fi ;;
"load")
if _sp_full_spec=$(command spack $_sp_flags tcl find $_sp_subcommand_args "${_sp_spec[@]}"); then
module load $_sp_module_args $_sp_full_spec
+ else
+ $(exit 1)
fi ;;
"unload")
if _sp_full_spec=$(command spack $_sp_flags tcl find $_sp_subcommand_args "${_sp_spec[@]}"); then
module unload $_sp_module_args $_sp_full_spec
+ else
+ $(exit 1)
fi ;;
esac
;;