Skip to content

Commit

Permalink
Merge pull request #197 from vladh/dots
Browse files Browse the repository at this point in the history
Add support for filenames with dots in them
  • Loading branch information
lovasoa authored Feb 24, 2023
2 parents 8ca2330 + b830623 commit 34bcbf0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/output_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ pub fn get_outname(
.map(|s| sanitize(s))
.filter(|s| !s.is_empty())
.unwrap_or_else(|| "dezoomified".into());
let mut path = base_dir.join(base).with_extension(extension);
let mut path = base_dir.to_path_buf();
let mut base_with_ext = OsString::from(&base);
base_with_ext.push(".");
base_with_ext.push(&extension);
path = path.join(base_with_ext);

// append a suffix (_1,_2,..) to `outname` if the file already exists
let filename = path.file_stem().map(OsString::from).unwrap_or_default();
Expand Down

0 comments on commit 34bcbf0

Please sign in to comment.