diff --git a/src/cli/subcommand/plan.rs b/src/cli/subcommand/plan.rs index 5a51944..a1d4877 100644 --- a/src/cli/subcommand/plan.rs +++ b/src/cli/subcommand/plan.rs @@ -44,7 +44,7 @@ impl CommandExecute for Plan { }; let json = serde_json::to_string_pretty(&install_plan)?; - tokio::fs::write(output, json) + tokio::fs::write(output, format!("{json}\n")) .await .wrap_err("Writing plan")?; diff --git a/src/plan.rs b/src/plan.rs index ca5ed3b..d144835 100644 --- a/src/plan.rs +++ b/src/plan.rs @@ -331,7 +331,7 @@ async fn write_receipt(plan: InstallPlan) -> Result<(), NixInstallerError> { let install_receipt_path = PathBuf::from(RECEIPT_LOCATION); let self_json = serde_json::to_string_pretty(&plan).map_err(NixInstallerError::SerializingReceipt)?; - tokio::fs::write(&install_receipt_path, self_json) + tokio::fs::write(&install_receipt_path, format!("{self_json}\n")) .await .map_err(|e| NixInstallerError::RecordingReceipt(install_receipt_path, e))?; Result::<(), NixInstallerError>::Ok(()) diff --git a/tests/fixtures/linux/linux.json b/tests/fixtures/linux/linux.json index f136bb3..dcc5a7c 100644 --- a/tests/fixtures/linux/linux.json +++ b/tests/fixtures/linux/linux.json @@ -915,4 +915,4 @@ "start_daemon": true } } -} \ No newline at end of file +} diff --git a/tests/fixtures/linux/steam-deck.json b/tests/fixtures/linux/steam-deck.json index 862f1f8..9805009 100644 --- a/tests/fixtures/linux/steam-deck.json +++ b/tests/fixtures/linux/steam-deck.json @@ -937,4 +937,4 @@ "start_daemon": true } } -} \ No newline at end of file +} diff --git a/tests/fixtures/macos/macos.json b/tests/fixtures/macos/macos.json index f6ea546..5200f39 100644 --- a/tests/fixtures/macos/macos.json +++ b/tests/fixtures/macos/macos.json @@ -969,4 +969,4 @@ "volume_label": "Nix Store", "root_disk": "disk3" } -} \ No newline at end of file +}