Skip to content

Commit

Permalink
Add ability to test a shell name on "module-info shell"
Browse files Browse the repository at this point in the history
Update Tcl "module-info shell" command to be able to test a shell name
argument and return if this shell name corresponds to the current shell
of the user.

This change helps to get the same behavior than Environment Modules
(introduced in version 4.0) and makes Lmod compatible with the Tcl
modulefile produced by the Singularity HPC tool.
  • Loading branch information
xdelaruelle committed Jan 10, 2025
1 parent 1f416cc commit d245df0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tcl2lua.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,15 @@ proc module-info {what {more {}}} {
}
}
"shell" {
return $g_shellName
if {$more ne {}} {
if {$g_shellName eq $more} {
return 1
} else {
return 0
}
} else {
return $g_shellName
}
}
"shelltype" {
return $g_shellType
Expand Down

0 comments on commit d245df0

Please sign in to comment.