[SCons] Expand environment variables and ~/ when used in cantera.conf
This commit is contained in:
parent
4de4aa3f65
commit
9279e0828e
1 changed files with 10 additions and 0 deletions
10
SConstruct
10
SConstruct
|
|
@ -626,6 +626,16 @@ opts.AddVariables(*config_options)
|
|||
opts.Update(env)
|
||||
opts.Save('cantera.conf', env)
|
||||
|
||||
# Expand ~/ and environment variables used in cantera.conf (variables used on
|
||||
# the command line will be expanded by the shell)
|
||||
for option in opts.keys():
|
||||
original = env[option]
|
||||
if isinstance(original, str):
|
||||
modified = os.path.expandvars(os.path.expanduser(env[option]))
|
||||
if original != modified:
|
||||
print('INFO: Expanding {!r} to {!r}'.format(original, modified))
|
||||
env[option] = modified
|
||||
|
||||
if 'help' in COMMAND_LINE_TARGETS:
|
||||
### Print help about configuration options and exit.
|
||||
print("""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue