Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
cli: must create output directory if it doesn't exist already
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype committed Oct 11, 2018
1 parent e755f58 commit f779813
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Lib/cu2qu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ def main(args=None):
parser.error("-o/--output-file can't be used with multile inputs")

if options.output_dir:
output_dir = options.output_dir
if not os.path.exists(output_dir):
os.mkdir(output_dir)
elif not os.path.isdir(output_dir):
parser.error("'%s' is not a directory" % output_dir)
output_paths = [
os.path.join(options.output_dir, os.path.basename(p))
os.path.join(output_dir, os.path.basename(p))
for p in options.infiles
]
elif options.output_file:
Expand Down

0 comments on commit f779813

Please sign in to comment.