diff --git a/src/cli.rs b/src/cli.rs index adcc629..428b934 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -544,9 +544,10 @@ impl Opts { std::fs::create_dir(&self.folder)?; } let path = self.folder.join("sources.json"); - let fh = std::fs::File::create(&path) + let mut fh = std::fs::File::create(&path) .with_context(move || format!("Failed to open {} for writing.", path.display()))?; - serde_json::to_writer_pretty(fh, &versions::to_value_versioned(pins))?; + serde_json::to_writer_pretty(&mut fh, &versions::to_value_versioned(pins))?; + fh.write_all(b"\n")?; Ok(()) }