-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding MODULES_SITECONFIG env. variable support #235
Conversation
Codecov Report
@@ Coverage Diff @@
## master #235 +/- ##
==========================================
+ Coverage 98.63% 98.64% +<.01%
==========================================
Files 2 2
Lines 2423 2427 +4
==========================================
+ Hits 2390 2394 +4
Misses 33 33
Continue to review full report at Codecov.
|
modulecmd.tcl.in
Outdated
return @etcdir@/siteconfig.tcl | ||
} | ||
|
||
set g_siteconfig [getSiteConfig] ;# Site configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that getSiteConfig
follow the same scheme than getAutoHandling
, which means it should set the ::g_siteconfig if it is not set and returns its value in any cases. To set the global variable, it uses the @etcdir@/siteconfig.tcl
value by default or the env(MODULES_SITECONFIG) if set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By this, do you also mean that any pieces of downstream code reference [getSiteConfig]
rather than referring to $g_siteconfig
?
for example this:
if {[file readable $g_siteconfig]} {
reportDebug "Source site configuration ($g_siteconfig)"
if {[catch {source $g_siteconfig} errMsg]} {
to this:
if {[file readable [getSiteConfig]]} {
reportDebug "Source site configuration ([getSiteConfig])"
if {[catch {source [getSiteConfig]} errMsg]} {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly.
Some non-regression tests should be added to Also the |
@xdelaruelle pushed another update, this time with change in priority of sourcing the siteconfig. First will try to source |
d489bf9
to
5e516b6
Compare
I have rearranged things a bit, should be good now. Thanks for this contribution. |
Add the ability to define a site-specific configuration file with an environment variable: MODULES_SITECONFIG. When set, the script file pointed by the variable is sourced (if readable) after the site-specific configuration file initially defined in modulecmd.tcl. Fixes envmodules#234.
Proposal for issue #234