Files
modules/doc/example/modulepaths-persist-over-sudo/rc
Colin Marquardt 9b2cad1d7d doc: highlight code included in cookbook recipes
Specify language directive for included Tcl script files in cookbook
recipes to get their code highlighted in resulting HTML documents. As
Pygment Tcl lexer used by Sphinx does not support the whole Tcl syntax,
scripts of modulepaths-persist-over-sudo and test-modulefiles recipes
have been adapted to enable highlighting. Change has not been performed
over the expose-procs-vars-to-modulefiles and top-priority-values
recipes as their code cannot be adapted to match lexer needs.
2020-01-08 23:07:23 -07:00

16 lines
515 B
Plaintext

#%Module
# ensure MODULEPATH is always defined, use content of .modulespath config file
# to initialize it if not defined
if {![is-used] && [file readable /usr/share/Modules/init/.modulespath]} {
set fid [open /usr/share/Modules/init/.modulespath r]
set fdata [split [read $fid] "\n"]
close $fid
foreach fline $fdata {
if {[regexp "^\\s*(.*?)\\s*(#.*|)\$" $fline match patharg] == 1
&& $patharg ne {}} {
eval module use --append [split $patharg :]
}
}
}