Skip to content

Commit

Permalink
Fix get_output_file
Browse files Browse the repository at this point in the history
  • Loading branch information
fireattack committed Oct 2, 2023
1 parent faa836a commit 9a9a4c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chapter_converter/chapter_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ def get_output_file(args: argparse.Namespace):
if args.output:
output_file = Path(args.output)
else:
stem = Path(args.filename).stem
f = Path(args.filename)
if args.format == 'pot':
output_file = f'{stem}.pbf'
output_file = f.with_suffix('.pbf')
elif args.format == 'xml':
output_file = f'{stem}.xml'
output_file = f.with_suffix('.xml')
else:
output_file = f'{stem}.{args.format}.txt'
output_file = f.with_suffix(f'.{args.format}.txt')
if args.yes:
if output_file.exists():
print(f'{output_file} already exists, will overwrite it.')
Expand Down

0 comments on commit 9a9a4c0

Please sign in to comment.