From dce6d0058fadfc3895314ace03268751c515eb7e Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 13 Dec 2021 09:35:15 +0100 Subject: [PATCH] modulecmd: made get_module_prefix() global --- Pmodules/modulecmd.bash.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 1ef3f28..a3dddc1 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -213,6 +213,14 @@ is_modulefile() { [[ "${shebang:0:8}" == '#%Module' ]] || [[ "${shebang:0:9}" == '#%Pmodule' ]] } +get_module_prefix() { + local "$1" + local modulefile="$2" + local -r _prefix=$("${modulecmd}" bash show "${modulefile}" 2>&1 | \ + ${awk} '/_PREFIX |_HOME / {print $3; exit}') + std::upvar $1 "${_prefix}" +} + subcommand_generic0() { local -r subcommand="$1" shift @@ -2267,14 +2275,6 @@ subcommand_search() { ${awk} "${with_modules}") } - get_module_prefix() { - local "$1" - local modulefile="$2" - local -r _prefix=$("${modulecmd}" bash show "${modulefile}" 2>&1 | \ - ${awk} '/_PREFIX |_HOME / {print $3; exit}') - std::upvar $1 "${_prefix}" - } - #..................................................................... # # search modules