diff --git a/packages/hurlfmt/src/main.rs b/packages/hurlfmt/src/main.rs index da6924ec3..e731c45ee 100644 --- a/packages/hurlfmt/src/main.rs +++ b/packages/hurlfmt/src/main.rs @@ -239,10 +239,10 @@ fn main() { process::exit(1); } }; - let output = if output.ends_with('\n') { - output - } else { + let output = if !output.ends_with('\n') && !cli::has_flag(&matches, "no_format") { format!("{}\n", output) + } else { + output }; write_output(output.into_bytes(), output_file.as_deref()); }