mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-08-09 20:50:29 +02:00
modulecmd: using/unusing group/modulepath fixed
using a group must have precedence over a directory containing modulefiles. Otherwise something like `module load Tools` doesn't work as expected if Tools is a subdirectory of the current working directory.
This commit is contained in:
@@ -1577,11 +1577,6 @@ subcommand_use() {
|
|||||||
use_overlay "${arg}"
|
use_overlay "${arg}"
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
if [[ -d ${arg} ]]; then
|
|
||||||
local dir=$(cd "${arg}" && pwd -L)
|
|
||||||
${add2path_func} MODULEPATH "${dir}"
|
|
||||||
return $?
|
|
||||||
fi
|
|
||||||
if [[ ! -v GroupDepths[${arg}] ]]; then
|
if [[ ! -v GroupDepths[${arg}] ]]; then
|
||||||
# this scan is required if a new group has been
|
# this scan is required if a new group has been
|
||||||
# create inside an used overlay
|
# create inside an used overlay
|
||||||
@@ -1592,6 +1587,11 @@ subcommand_use() {
|
|||||||
use_group "${arg}"
|
use_group "${arg}"
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
|
if [[ -d ${arg} ]]; then
|
||||||
|
local dir=$(cd "${arg}" && pwd -L)
|
||||||
|
${add2path_func} MODULEPATH "${dir}"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
die_invalid_value "use flag, group, overlay or directory" \
|
die_invalid_value "use flag, group, overlay or directory" \
|
||||||
"${arg}"
|
"${arg}"
|
||||||
} # use ()
|
} # use ()
|
||||||
@@ -1745,7 +1745,7 @@ subcommand_unuse() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if [[ -d ${arg} ]]; then
|
if [[ -d ${arg} ]]; then
|
||||||
local dir=$(cd "${arg} && pwd -L")
|
local dir=$(std::get_abspath "${arg}")
|
||||||
std::remove_path MODULEPATH "${dir}"
|
std::remove_path MODULEPATH "${dir}"
|
||||||
fi
|
fi
|
||||||
if [[ -n ${GroupDepths[${arg}]} ]]; then
|
if [[ -n ${GroupDepths[${arg}]} ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user