[cli] Fall back to "Windows" platform by default

This commit is contained in:
derrod 2022-01-02 13:17:18 +01:00
parent e44998b786
commit cc44149e68
2 changed files with 10 additions and 4 deletions

View file

@ -664,6 +664,8 @@ disable_auto_aliasing = false
default_platform = Windows default_platform = Windows
; (macOS) Disable automatic CrossOver use ; (macOS) Disable automatic CrossOver use
disable_auto_crossover = false disable_auto_crossover = false
; Fallback to "Windows" platform if native version unavailable
install_platform_fallback = true
[Legendary.aliases] [Legendary.aliases]
; List of aliases for simpler CLI use ; List of aliases for simpler CLI use

View file

@ -783,10 +783,14 @@ class LegendaryCLI:
if args.platform not in game.asset_infos: if args.platform not in game.asset_infos:
if not args.no_install: if not args.no_install:
logger.error(f'No app asset found for platform "{args.platform}", run ' if self.core.lgd.config.getboolean('Legendary', 'install_platform_fallback', fallback=True):
f'"legendary info --platform {args.platform}" and make ' logger.warning(f'App has no asset for platform "{args.platform}", falling back to "Windows".')
f'sure the app is available for the specified platform.') args.platform = 'Windows'
exit(1) 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: else:
logger.warning(f'No asset found for platform "{args.platform}", ' logger.warning(f'No asset found for platform "{args.platform}", '
f'trying anyway since --no-install is set.') f'trying anyway since --no-install is set.')