From ee1b2e468f7e0f5f3b3e98ea26e2516c7dce7b45 Mon Sep 17 00:00:00 2001 From: Lach Date: Wed, 26 Aug 2020 13:34:50 +0500 Subject: [PATCH] feat: print file name on multi output --- cmds/jrsonnet/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmds/jrsonnet/src/main.rs b/cmds/jrsonnet/src/main.rs index 3c81096b..b57d58e1 100644 --- a/cmds/jrsonnet/src/main.rs +++ b/cmds/jrsonnet/src/main.rs @@ -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 { @@ -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)?); }