Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ async function writeConfig(

await Deno.writeTextFile(
configContent.config?.path ?? join(Deno.cwd(), "deno.jsonc"),
config.toString() + "\n",
config.toString(),
);

if (!configContent.config) {
Expand Down
23 changes: 23 additions & 0 deletions tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,29 @@ Deno.test("deploy preserves comments and formatting (jsonc)", async () => {
assertStringIncludes(out, "// and this one");
});

Deno.test("deploy does not append a blank line on repeated updates", async () => {
const input = `{
"deploy": {
"org": "old-org",
"app": "my-app"
}
}
`;
const expected = `{
"deploy": {
"org": "my-org",
"app": "my-app"
}
}
`;

const once = await runDeploy(input, { org: "my-org", app: "my-app" });
const twice = await runDeploy(once, { org: "my-org", app: "my-app" });

assertEquals(once, expected);
assertEquals(twice, expected);
});

// Regression: a read-only command (one that never touches `config.files`) must
// NOT trigger the recursive deploy-manifest file walk. Before the lazy-`files`
// fix, `actionHandler` eagerly walked the whole working directory, so commands
Expand Down
Loading