From e892da34cf73e222942b474b90b4ecf007016453 Mon Sep 17 00:00:00 2001 From: Lil-Ran Date: Fri, 19 Sep 2025 20:02:24 +0800 Subject: [PATCH] fix: check output_dir is dir --- oneshot/shot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/oneshot/shot.py b/oneshot/shot.py index fb3ae89..f71aee6 100644 --- a/oneshot/shot.py +++ b/oneshot/shot.py @@ -309,6 +309,10 @@ def main(): if args.output_dir and not os.path.exists(args.output_dir): os.makedirs(args.output_dir) + if args.output_dir and not os.path.isdir(args.output_dir): + logger.error(f'{Fore.RED}Cannot use {repr(args.output_dir)} as output directory{Style.RESET_ALL}') + return + if os.path.isfile(args.directory): if specified_runtime is None: logger.error(f'{Fore.RED}Please specify `pyarmor_runtime` file by `-r` if input is a file{Style.RESET_ALL}')