modulecmd.bash.in: fixes in sub-commands 'use' and 'unuse'

- adding/removing a group did not add/remove the directory to
  MODULEPATH
This commit is contained in:
2019-05-24 16:02:34 +02:00
parent a0c62dc92c
commit 597fad40b8
+6 -2
View File
@@ -1055,7 +1055,9 @@ subcommand_use() {
(( ${GroupDepths[${arg}]} == 0 )); then
# argument is group in our root with depth 0
std::append_path UsedGroups "${arg}"
${add2path_func} MODULEPATH "${modulefiles_dir}"
local dir="${PMODULES_ROOT}/${arg}/"
dir+="${PMODULES_MODULEFILES_DIR}"
${add2path_func} MODULEPATH "${dir}"
return
fi
if [[ -n ${GroupDepths[${arg}]} ]] &&
@@ -1159,7 +1161,9 @@ subcommand_unuse() {
"${arg}"
fi
std::remove_path UsedGroups "${arg}"
std::remove_path MODULEPATH "${modulefiles_dir}"
local dir="${PMODULES_ROOT}/${arg}/"
dir+="${PMODULES_MODULEFILES_DIR}"
std::remove_path MODULEPATH "${dir}"
return
fi
if [[ -n ${GroupDepths[${arg}]} ]] &&