Skip to content

Commit

Permalink
Fix force directory create
Browse files Browse the repository at this point in the history
  • Loading branch information
akadan47 committed Oct 31, 2016
1 parent 36c59c7 commit e9a306e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dbf2csv/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ def process_directory(input_dir_path, output_dir_path, args):
if not input_files:
exit(0)

if output_dir_path != input_dir_path:
if not os.path.exists(output_dir_path):
os.makedirs(output_dir_path)

for input_file_path in input_files:
output_file_path = '{}/{}.csv'.format(
output_dir_path,
os.path.splitext(os.path.basename(input_file_path))[0]
)
if output_dir_path != input_dir_path:
if not os.path.exists(output_dir_path):
os.makedirs(output_dir_path)

process_file(input_file_path, output_file_path, args)


Expand Down

0 comments on commit e9a306e

Please sign in to comment.