mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-28 18:29:39 +02:00
modulecmd: made get_module_prefix() global
This commit is contained 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
|
||||
|
||||
Reference in New Issue
Block a user