mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 18:13:08 +02:00
Merge branch '88-fix-module-load-with-csh-is-broken' into 'master'
Resolve "fix: module load with csh is broken" Closes #88 See merge request Pmodules/src!52
This commit is contained in:
@@ -495,7 +495,6 @@ subcommand_load() {
|
||||
|| std::die 1 "Oops: unable to create tmp file!\n"
|
||||
local output=$("${modulecmd}" 'bash' ${opts} 'load' \
|
||||
"${current_modulefile}" 2> "${tmpfile}")
|
||||
eval "${output}"
|
||||
|
||||
# we do not want to print the error message we got from
|
||||
# modulecmd, they are a bit ugly
|
||||
@@ -516,15 +515,18 @@ subcommand_load() {
|
||||
"${error_txt}" \
|
||||
"${m}"
|
||||
fi
|
||||
if [[ "${Shell}" == "bash" ]]; then
|
||||
if [[ "${Shell}" == "sh" ]]; then
|
||||
# for sh-like shells just echo
|
||||
echo "${output}"
|
||||
if [[ -n "${error}" ]]; then
|
||||
echo "${error}" 1>&2
|
||||
fi
|
||||
else
|
||||
# re-run with right shell
|
||||
"${modulecmd}" "${Shell}" ${opts} 'load' \
|
||||
"${current_modulefile}"
|
||||
fi
|
||||
eval "${output}"
|
||||
if [[ -n "${error}" ]]; then
|
||||
echo "${error}" 1>&2
|
||||
fi
|
||||
|
||||
local msg=$(printf "%s %s: %s -- %s" \
|
||||
"${CMD}" 'load' \
|
||||
|
||||
Reference in New Issue
Block a user