mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
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.
16 lines
515 B
Plaintext
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 :]
|
|
}
|
|
}
|
|
}
|