From c52cd09eb72f482e5ebee330aef08b5fec25c768 Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 23 May 2020 18:33:11 +0200 Subject: [PATCH] [cli/core] Add env var for wrapper and fix priority Priority should always be command line > env var > config --- legendary/cli.py | 1 + legendary/core.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/legendary/cli.py b/legendary/cli.py index a5a31b3..55333fe 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -839,6 +839,7 @@ def main(): launch_parser.add_argument('--language', dest='language', action='store', metavar='', help='Override language for game launch (defaults to system settings)') launch_parser.add_argument('--wrapper', dest='wrapper', action='store', metavar='', + default=os.environ.get('LGDRY_WRAPPER', None), help='Wrapper command to launch game with') if os.name != 'nt': diff --git a/legendary/core.py b/legendary/core.py index ed127a0..f850635 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -253,7 +253,7 @@ class LegendaryCore: params = [] - if wrapper := self.lgd.config.get(app_name, 'wrapper', fallback=wrapper): + if wrapper or (wrapper := self.lgd.config.get(app_name, 'wrapper')): params.extend(shlex.split(wrapper)) if os.name != 'nt' and not disable_wine: