mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-11-13 01:24:00 +01:00
Merge branch '317-modulecmd-eval-output-of-modulecmd-bin-only-if-not-empty' into 'master'
Resolve "modulecmd: eval output of modulecmd.bin only if not empty" Closes #317 See merge request Pmodules/src!296
This commit is contained in:
commit
b31d39bce9
1 file changed
+5
-2
@@ -959,12 +959,15 @@ subcommand_unload() {
|
||||
if [[ "${lmfile}" == '_zzzz_' ]]; then
|
||||
continue
|
||||
fi
|
||||
# yes, module has been loaded
|
||||
local interp
|
||||
is_modulefile modulecmd "${lmfile}" || die_not_a_modulefile "${lmfile}"
|
||||
is_modulefile modulecmd "${lmfile}" || die_not_a_modulefile "${arg}"
|
||||
|
||||
local output=''
|
||||
output=$("${modulecmd}" "${Shell}" 'unload' "${arg}")
|
||||
eval "$(echo "${output}"|${sed} -e 's/;unalias [^;]*//g')"
|
||||
if [[ -n "${output}" ]]; then
|
||||
eval "$(echo "${output}"|${sed} -e 's/;unalias [^;]*//g')"
|
||||
fi
|
||||
case ${Shell} in
|
||||
sh | bash | zsh )
|
||||
echo "${output}"
|
||||
|
||||
Reference in new issue
Block a user