From 3e01cb0beb793bfe07f275341859c161d3811a41 Mon Sep 17 00:00:00 2001 From: Sebastian Gieseler Date: Tue, 10 Nov 2026 16:30:52 +0100 Subject: [PATCH] docs: say which shell runs a command's exec step An exec step runs in the platform shell (cmd /d /s /c on Windows, sh -c elsewhere), and passing a variable is not portable between the two. Name both, show the one-line form in each, and the portable way (a profile's env, or a script argument). The devstack-config skill says the same. Closes #503 Co-Authored-By: Claude Opus 5.5 --- docs/stack-file.md | 16 ++++++++++++++++ skills/devstack-config/SKILL.md | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/docs/stack-file.md b/docs/stack-file.md index 5a5c2840..1a0b576f 100644 --- a/docs/stack-file.md +++ b/docs/stack-file.md @@ -991,6 +991,22 @@ published address of a Compose service's port, as for services, and `{compose..project}`) and `${VAR}`; `{port}`, `{artifact}` and `{is_main}` have no value in a command. +An `exec` line is run by the platform shell: `cmd /d /s /c` on Windows, +`sh -c` on Linux and macOS (as a service's `run` and `build`). devstack +expands the placeholders before the shell sees the line; everything else +is the shell's syntax, and that is not portable. Handing a variable to the +step's program, say the address a test suite runs against: + +```toml +{ exec = 'E2E_URL={service.web.url} npx playwright test' } # sh: Linux, macOS +{ exec = 'set "E2E_URL={service.web.url}" && npx playwright test' } # cmd: Windows +``` + +Each line fails under the other shell. A file used on both needs no shell +syntax for it: a profile's `env` reaches every `exec` step +(`[profiles.]`, below), or the step runs a script that takes +`{service.web.url}` as an argument (`node e2e/run.mjs {service.web.url}`). + Name a Compose project with `{compose..project}`, never literally: the same command runs in a lane, whose containers are the project `-`. With `-p shop-dev` written out, the example above would diff --git a/skills/devstack-config/SKILL.md b/skills/devstack-config/SKILL.md index 4b250b7a..ab73068b 100644 --- a/skills/devstack-config/SKILL.md +++ b/skills/devstack-config/SKILL.md @@ -167,6 +167,10 @@ without a stack file starts from `devstack init` (a draft with TODOs). sets `timeout = "…"`; give a long seed or migration one. - **Commands with side effects** (deleting data, resetting state) get a `confirm` text. Steps run in order; one action per step. +- **`exec` runs in the platform shell**: `cmd /d /s /c` on Windows, `sh -c` + elsewhere. `VAR=x cmd` works only under `sh`, `set "VAR=x" && cmd` only + under `cmd`; for a file used on both, pass the value through a profile's + `env` or as an argument to a script. - **Secrets** do not belong in the stack file. Use `${VAR}` and an env file that is not committed (`stack.env_files`), with a committed `.env.example` beside it.