mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[cli/core] Fix config offline and environment overrides
This commit is contained in:
parent
76b7360732
commit
1b3ef31963
|
@ -128,7 +128,9 @@ class LegendaryCLI:
|
|||
logger.error(f'{app_name} is DLC; please launch the base game instead!')
|
||||
exit(1)
|
||||
|
||||
if not args.offline and not self.core.is_offline_game(app_name):
|
||||
# override with config value
|
||||
args.offline = self.core.is_offline_game(app_name)
|
||||
if not args.offline:
|
||||
logger.info('Logging in...')
|
||||
if not self.core.login():
|
||||
logger.error('Login failed, cannot continue!')
|
||||
|
|
|
@ -253,11 +253,11 @@ class LegendaryCore:
|
|||
params.extend(shlex.split(config_args.strip()))
|
||||
|
||||
# get environment overrides from config
|
||||
env = None
|
||||
env = os.environ.copy()
|
||||
if f'{app_name}.env' in self.lgd.config:
|
||||
env = dict(self.lgd.config[f'{app_name}.env'])
|
||||
env.update(dict(self.lgd.config[f'{app_name}.env']))
|
||||
elif 'default.env' in self.lgd.config:
|
||||
env = dict(self.lgd.config['default.env'])
|
||||
env.update(dict(self.lgd.config['default.env']))
|
||||
|
||||
return params, working_dir, env
|
||||
|
||||
|
|
Loading…
Reference in a new issue