From 443d702971be3ce7fa203348cb3eae16b55e0909 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 10 Jul 2018 10:54:55 +0200 Subject: 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. --- share/spack/setup-env.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'share') 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 ;; -- cgit v1.2.3-70-g09d2