Skip to content

Commit

Permalink
doc: fix modulecmd state check in recipe code
Browse files Browse the repository at this point in the history
Code to handle the internal states of modulecmd have been reworked on
Modules v4.6. As a consequence several siteconfig.tcl extension scripts
described on documentation recipes have to be adapted.

Closes #396
  • Loading branch information
xdelaruelle committed May 9, 2021
1 parent 15cdc75 commit e211772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/example/log-module-commands/siteconfig.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# override 'module' procedure to log each call made by user
rename ::module ::__module
proc module {command args} {
if {[getEvalModuleStackDepth] == 0} {
if {[depthState modulename] == 0} {
exec logger -t module "[get-env USER]: $command [join $args]"
}
return [eval __module "{$command}" $args]
Expand Down
4 changes: 2 additions & 2 deletions doc/example/top-priority-values/siteconfig.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ proc setenv {args} {

if {$topPriority} {
# define an helper variable to know a top-priority value has been set
if {[currentMode] ne "display"} {
if {[currentState mode] ne "display"} {
__setenv MODULES_PRIORITY_$var $val
}
__setenv $var $val
Expand Down Expand Up @@ -77,7 +77,7 @@ proc setenv-un {args} {

if {$topPriority} {
# define an helper variable to know a top-priority value has been set
if {[currentMode] ne "display"} {
if {[currentState mode] ne "display"} {
__setenv-un MODULES_PRIORITY_$var $val
}
__setenv-un $var $val
Expand Down

0 comments on commit e211772

Please sign in to comment.