Skip to content

Commit

Permalink
Smarter handling of dest dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Aug 29, 2020
1 parent 5b40a1b commit af4047a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ fn run() -> Result<(), BoxError> {
return Err("No PNG/JPEG files specified".into());
}

let use_dir = output.is_some() && files.len() > 1;
let mut use_dir = output.is_some() && files.len() > 1;
if let Some(out) = &output {
if use_dir {
if out.is_dir() {
use_dir = true;
}
else if use_dir {
let _ = fs::create_dir_all(out);
}
}
Expand Down

0 comments on commit af4047a

Please sign in to comment.