Skip to content

Commit

Permalink
Merge pull request #107: Add a newline at the end of sources.json
Browse files Browse the repository at this point in the history
  • Loading branch information
piegamesde authored Dec 5, 2024
2 parents 6271c94 + c7b3cef commit 4dbde2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down

0 comments on commit 4dbde2a

Please sign in to comment.