mirror of
https://github.com/derrod/legendary.git
synced 2025-01-03 04:45:28 +00:00
[core] Ignore comments in configuration environment variables
Comments are treated as keys with no value by configparser, but env variables with None as the value are not valid so this would crash. Fixes #156
This commit is contained in:
parent
5e1896cf2c
commit
3e2a6011ff
|
@ -375,9 +375,9 @@ class LegendaryCore:
|
|||
# get environment overrides from config
|
||||
env = os.environ.copy()
|
||||
if 'default.env' in self.lgd.config:
|
||||
env.update(dict(self.lgd.config['default.env']))
|
||||
env.update({k: v for k, v in self.lgd.config[f'default.env'].items() if v and not k.startswith(';')})
|
||||
if f'{app_name}.env' in self.lgd.config:
|
||||
env.update(dict(self.lgd.config[f'{app_name}.env']))
|
||||
env.update({k: v for k, v in self.lgd.config[f'{app_name}.env'].items() if v and not k.startswith(';')})
|
||||
|
||||
if wine_pfx:
|
||||
env['WINEPREFIX'] = wine_pfx
|
||||
|
|
Loading…
Reference in a new issue