Pmodules/modulecmd.bash.in

- bugfix in subcommand_load(): modules may write something to stderr while loading.
This commit is contained in:
2018-10-16 14:38:58 +02:00
parent 0623f2d0ab
commit 28f787cf83
+4 -4
View File
@@ -824,10 +824,10 @@ subcommand_load() {
local output=$("${modulecmd}" "${shell}" ${opts} load "${current_modulefile}" 2> "${tmpfile}")
echo "${output}"
eval "${output}"
error=$( < "${tmpfile}")
if [[ -n "${error}" ]]; then
echo "${error}" 1>&2
std::die 4 "${CMD} load: failed -- ${m}"
local error=$( < "${tmpfile}")
echo "${error}" 1>&2
if [[ "${error}" =~ ":ERROR:" ]]; then
std::info "${CMD} load: failed -- ${m}"
fi
if [[ ${verbosity_lvl} != silent ]] && [[ ${release} != stable ]]; then
std::info "Warning: the ${release} module '${m}' has been loaded."