mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-26 17:43:09 +02:00
Pmodule modulefile: remove Pmodules bin dir from PATH
in some cases it might happen that we have a Pmodules bin directory in PATH. This has to be removed if we load a Pmodule module.
This commit is contained in:
@@ -8,3 +8,15 @@ module-maintainer "Achim Gsell <achim.gsell@psi.ch>"
|
||||
module-help "
|
||||
Pmodules are a hierarchical module environment based on Environment Modules.
|
||||
"
|
||||
|
||||
#
|
||||
# It might be that '${PMODULES_ROOT}/Tools/Pmodules/VERSION' is in PATH.
|
||||
# Why? With older version the PATH might have been set without loading
|
||||
# a module.
|
||||
#
|
||||
if { [module-info mode load] } {
|
||||
set PATH ":$::env(PATH):"
|
||||
if { [regexp -- {.*:(.*/Pmodules/[^:]*):} $PATH -> str] } {
|
||||
remove-path PATH $str
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user