Produce output file in current directory instead of source directory 📂

This commit is contained in:
Laurenz 2020-11-05 12:30:46 +01:00
parent ee38c6aa9a
commit e26b431bee

View File

@ -22,7 +22,10 @@ fn main() {
let src_path = Path::new(&args[1]);
let dest_path = if args.len() <= 2 {
src_path.with_extension("pdf")
let name = src_path
.file_name()
.expect("source path is not a file");
Path::new(name).with_extension("pdf")
} else {
PathBuf::from(&args[2])
};