From 363ac15faa23766b464f1304e3b15af2e574bec9 Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 28 Dec 2021 10:04:37 +0100 Subject: [PATCH] [cli] Error out if no asset exists for specified platform --- legendary/cli.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/legendary/cli.py b/legendary/cli.py index f761a0b..82dc43b 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -739,6 +739,16 @@ class LegendaryCLI: f'activate and/or run the game.') exit(0) + 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 list-games --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.') + if game.is_dlc: logger.info('Install candidate is DLC') app_name = game.metadata['mainGameItem']['releaseInfo'][0]['appId']