mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 10:03:08 +02:00
Merge branch '113-modulefile-fix-path-mangling' into 'master'
Resolve "modulefile: fix PATH mangling" Closes #113 See merge request Pmodules/src!81
This commit is contained in:
@@ -8,3 +8,17 @@ 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] } {
|
||||
if { [string compare $str $PREFIX/bin] != 0 } {
|
||||
remove-path PATH $str
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user