[cli/core] Fix config offline and environment overrides

This commit is contained in:
derrod 2020-04-26 14:58:09 +02:00
parent 76b7360732
commit 1b3ef31963
2 changed files with 6 additions and 4 deletions

View file

@ -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!')

View file

@ -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