Skip to content

Commit

Permalink
feat: print file name on multi output
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed Aug 26, 2020
1 parent 6cb98c9 commit ee1b2e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmds/jrsonnet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ fn main_real(state: &EvaluationState, opts: Opts) -> Result<(), Error> {
dir.pop();
create_dir_all(dir)?;
}
println!("{}", path.to_str().expect("path"));
let mut file = File::create(path)?;
write!(file, "{}", data)?;
writeln!(file, "{}", data)?;
}
} else if let Some(path) = opts.output.output_file {
if opts.output.create_output_dirs {
Expand All @@ -113,7 +114,7 @@ fn main_real(state: &EvaluationState, opts: Opts) -> Result<(), Error> {
create_dir_all(dir)?;
}
let mut file = File::create(path)?;
write!(file, "{}", state.manifest(val)?)?;
writeln!(file, "{}", state.manifest(val)?)?;
} else {
println!("{}", state.manifest(val)?);
}
Expand Down

0 comments on commit ee1b2e4

Please sign in to comment.