Skip to content

Commit

Permalink
Release 0.1.1, fixed a bug with output path creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rvoleti89 committed Jan 12, 2019
1 parent 12551e1 commit 2af6299
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/corrupt_text_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
corpus_file = os.path.expanduser(args.text_file)
if args.output_loc is not None:
output_dir = os.path.expanduser(args.output_loc)
if not Path(output_dir).is_dir():
print(f'Creating directory for saving corrupted text at {output_dir}')
os.makedirs(output_dir)
else:
output_dir = os.path.dirname(corpus_file)
corpus_file_no_ext = corpus_file.split('/')[-1].split('.')[0]
Expand Down

0 comments on commit 2af6299

Please sign in to comment.