1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

fix(lockfile): emit trailing newline (#17618)

This commit is contained in:
David Sherret 2023-02-01 15:57:02 -05:00 committed by GitHub
parent 690b6ac39e
commit f6f76a76b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -1306,7 +1306,8 @@ fn lock_file_lock_write() {
} }
} }
} }
}"#; }
"#;
temp_dir.write("deno.lock", lock_file_content); temp_dir.write("deno.lock", lock_file_content);
let deno = util::deno_cmd_with_deno_dir(&deno_dir) let deno = util::deno_cmd_with_deno_dir(&deno_dir)

View file

@ -187,7 +187,8 @@ impl Lockfile {
return Ok(()); return Ok(());
} }
let json_string = serde_json::to_string_pretty(&self.content).unwrap(); let mut json_string = serde_json::to_string_pretty(&self.content).unwrap();
json_string.push('\n'); // trailing newline in file
let mut f = std::fs::OpenOptions::new() let mut f = std::fs::OpenOptions::new()
.write(true) .write(true)
.create(true) .create(true)