Skip to content

Commit a4c463a

Browse files
committed
fix: newline in agentctl plan
1 parent 6f3e739 commit a4c463a

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

internal/cli/plan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func writePlanOutput(cmd *cobra.Command, env, dsn string, p *plan.Plan, g *Globa
9090
if _, err := fmt.Fprintf(out, "Environment: %s\nState: %s\n\n", env, dsn); err != nil {
9191
return err
9292
}
93-
_, err := fmt.Fprint(out, plan.FormatPlan(p))
93+
_, err := fmt.Fprintf(out, "%s\n", plan.FormatPlan(p))
9494
return err
9595
}
9696
}

internal/cli/plan_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func TestPlan_firstPlan_allCreates(t *testing.T) {
5353
if !strings.Contains(s, "Plan: 3 to add, 0 to change, 0 to delete") {
5454
t.Fatalf("summary missing in:\n%s", s)
5555
}
56+
if !strings.HasSuffix(s, "\n") {
57+
t.Fatalf("expected trailing newline in:\n%s", s)
58+
}
5659
for _, line := range []string{"+ create Project/plan-fixture", "+ create Policy/default", "+ create Tool/helper"} {
5760
if !strings.Contains(s, line) {
5861
t.Fatalf("missing %q in:\n%s", line, s)

0 commit comments

Comments
 (0)