From cc44149e68f32e38336660940343092e585a8de4 Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 2 Jan 2022 13:17:18 +0100 Subject: [PATCH] [cli] Fall back to "Windows" platform by default --- README.md | 2 ++ legendary/cli.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e898349..a3d9f82 100644 --- a/README.md +++ b/README.md @@ -664,6 +664,8 @@ disable_auto_aliasing = false default_platform = Windows ; (macOS) Disable automatic CrossOver use disable_auto_crossover = false +; Fallback to "Windows" platform if native version unavailable +install_platform_fallback = true [Legendary.aliases] ; List of aliases for simpler CLI use diff --git a/legendary/cli.py b/legendary/cli.py index 10540e8..dd69912 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -783,10 +783,14 @@ class LegendaryCLI: if args.platform not in game.asset_infos: if not args.no_install: - logger.error(f'No app asset found for platform "{args.platform}", run ' - f'"legendary info --platform {args.platform}" and make ' - f'sure the app is available for the specified platform.') - exit(1) + if self.core.lgd.config.getboolean('Legendary', 'install_platform_fallback', fallback=True): + logger.warning(f'App has no asset for platform "{args.platform}", falling back to "Windows".') + args.platform = 'Windows' + else: + logger.error(f'No app asset found for platform "{args.platform}", run ' + f'"legendary info --platform {args.platform}" and make ' + f'sure the app is available for the specified platform.') + exit(1) else: logger.warning(f'No asset found for platform "{args.platform}", ' f'trying anyway since --no-install is set.')