Expand environment variables in config file include directives
This commit is contained in:
parent
b9fa8dbe42
commit
e07d216a11
@ -48,7 +48,7 @@ def parse_line(line, type_map, special_handling, ans, all_keys, base_path_for_in
|
||||
if special_handling(key, val, ans):
|
||||
return
|
||||
if key == 'include':
|
||||
val = val.strip()
|
||||
val = os.path.expandvars(os.path.expanduser(val.strip()))
|
||||
if not os.path.isabs(val):
|
||||
val = os.path.join(base_path_for_includes, val)
|
||||
try:
|
||||
|
||||
@ -2,7 +2,9 @@
|
||||
|
||||
# You can include secondary config files via the "include" directive.
|
||||
# If you use a relative path for include, it is resolved with respect to the
|
||||
# location of the current config file. For example:
|
||||
# location of the current config file. Note that environment variables
|
||||
# are expanded, so ${USER}.conf becomes name.conf if USER=name
|
||||
# For example:
|
||||
# include other.conf
|
||||
|
||||
# Fonts {{{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user