Skip to content

Commit 52e4608

Browse files
committed
Fix output file incorrectly constructed in some cases
1 parent c55b6b4 commit 52e4608

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/app.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::error::Error;
22
use std::io::{BufReader, Read, Write};
3+
use std::path::PathBuf;
34
use std::process::{ChildStdin, Command, Stdio};
45
use std::sync::mpsc::{Receiver, Sender};
56
use std::{mem, thread};
@@ -312,10 +313,11 @@ impl App<'_> {
312313
let mut command_builder = CommandBuilder::default();
313314
apply_visitor(&mut command_builder, &mut self.params);
314315
let input = self.source.input.clone();
315-
let output_file = format!(
316-
"{}/{}.{}",
317-
self.output_folder, self.output_filename, command_builder.ext
318-
);
316+
let mut path = PathBuf::new()
317+
.join(&*self.output_folder)
318+
.join(&*self.output_filename);
319+
path.set_extension(&*command_builder.ext);
320+
let output_file = path.display().to_string();
319321

320322
let mut args: Vec<String> = Vec::new();
321323
if overwrite {

0 commit comments

Comments
 (0)