From ea1c06cc5aac8d87759f4b1f78b5664eea267fea Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 17 Aug 2026 18:19:47 +0000 Subject: [PATCH] refactor(devcontainer): flatten shell commands to single-line scripts Build entrypoint scripts by joining statements with '; ' instead of embedded newlines. Single-line scripts survive log lines and YAML string scalars intact (no more block-scalar '|' with blank lines). Preserves the '$$@' compose-YAML escaping required by docker compose's variable interpolation on the entrypoint round-trip; the prior draft of this refactor had regressed that to a single '$', which would break exec passthrough under compose. Signed-off-by: Samuel K --- pkg/devcontainer/compose_test.go | 59 ++++++++++++++++++++++++++++ pkg/devcontainer/compose_up.go | 15 +++++--- pkg/devcontainer/single.go | 40 ++++++++++++------- pkg/devcontainer/single_test.go | 66 ++++++++++++++++++++++++++++++++ 4 files changed, 161 insertions(+), 19 deletions(-) diff --git a/pkg/devcontainer/compose_test.go b/pkg/devcontainer/compose_test.go index 4a848398c1..516096cad9 100644 --- a/pkg/devcontainer/compose_test.go +++ b/pkg/devcontainer/compose_test.go @@ -727,6 +727,65 @@ func TestResolveServiceEntrypoint(t *testing.T) { }) } +func TestBuildOverrideEntrypointSingleLine(t *testing.T) { + script := buildOverrideEntrypoint( + &config.MergedDevContainerConfig{ + UpdatedConfigProperties: config.UpdatedConfigProperties{ + Entrypoints: []string{"echo setup"}, + }, + }, + nil, + ) + if len(script) < 3 { + t.Fatalf("expected at least [%s -c