diff --git a/legendary/cli.py b/legendary/cli.py index 319c88e..0e9e2f9 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -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!') diff --git a/legendary/core.py b/legendary/core.py index c629791..0dfd122 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -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