From 236a08fda74f34f5cd75d20d900d08dce0fbc332 Mon Sep 17 00:00:00 2001 From: CorpNewt <12772521+corpnewt@users.noreply.github.com> Date: Fri, 8 Mar 2024 12:48:13 -0600 Subject: [PATCH] Assume non-interactive with -p or -v check -v with -b --product and --version should already target only a single release and auto download/print URLs, so there's no need to have the user press a key after. --build always requires a --version to function, so let's check that before trying to load the products in order to bail early. --- gibMacOS.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gibMacOS.py b/gibMacOS.py index cccebb8..34999e5 100755 --- a/gibMacOS.py +++ b/gibMacOS.py @@ -606,11 +606,17 @@ if __name__ == '__main__': parser.add_argument("-D", "--device-id", help="use with --version or --latest to search for versions supporting the specified Device ID - eg VMM-x86_64 for any x86_64") parser.add_argument("-i", "--print-urls", help="only prints the download URLs, does not actually download them", action="store_true") parser.add_argument("-j", "--print-json", help="only prints the product metadata in JSON, does not actually download it", action="store_true") - parser.add_argument("--no-interactive", help="run in non-interactive mode", action="store_true") + parser.add_argument("--no-interactive", help="run in non-interactive mode (auto-enabled when using --product or --version)", action="store_true") parser.add_argument("-o", "--download-dir", help="overrides directory where the downloaded files are saved") args = parser.parse_args() - g = gibMacOS(interactive=not args.no_interactive, download_dir=args.download_dir) + if args.build and not (args.latest or args.product or args.version): + print("The --build option requires a --version") + exit(1) + + interactive = not any((args.no_interactive,args.product,args.version)) + g = gibMacOS(interactive=interactive, download_dir=args.download_dir) + if args.recovery: args.dmg = False g.find_recovery = args.recovery