modulecmd: bugfix if a Pmodule module have been loaded

after loading a Pmodule module the module was not displayed
with 'module list', this has been fixed
This commit is contained in:
2022-06-30 17:54:04 +02:00
parent 5727cc9ef8
commit aa4838ed2e
+14 -1
View File
@@ -2757,8 +2757,21 @@ if [[ -n ${PMODULES_ENV} ]]; then
eval "$("${base64}" -d <<< "${PMODULES_ENV}" 2>/dev/null)"
fi
if [[ -z ${Version} ]] || [[ ${Version} != ${PMODULES_VERSION} ]]; then
# this can only happen if the last command was
# module load Pmodules/${PMODULES_VERSION}
#
# the values these two variables must be saved before initialising
declare _tmp_loaded_modules_="${LOADEDMODULES}"
declare _tmp_lmfiles_="${_LMFILES_}"
pmodules_init
#g_env_must_be_saved='yes'
# restore and export
LOADEDMODULES="${_tmp_loaded_modules_}"
_LMFILES_="${_tmp_lmfiles_}"
export_env \
LOADEDMODULES \
_LMFILES_
fi
if (( ${#GroupDepths[@]} == 0 )); then