Skip to content

Commit ea4e40a

Browse files
committed
Fix output dir not exist
1 parent b6ca2a0 commit ea4e40a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

stream_translator_gpt/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,13 @@ def cli():
596596

597597
args.pop('list_format', None)
598598
args.pop('list_devices', None)
599+
600+
if args['output_file_path']:
601+
output_dir = os.path.dirname(os.path.abspath(args['output_file_path']))
602+
if not os.path.isdir(output_dir):
603+
print(f'{ERROR}Output directory does not exist: {output_dir}')
604+
sys.exit(1)
605+
599606
main(url, **args)
600607

601608

0 commit comments

Comments
 (0)