Skip to content

Commit e8857ca

Browse files
mnriemCopilot
andcommitted
fix: populate stderr from stdout on older Click, fix force comment wording
- When Click does not expose result.stderr (older versions where stderr is mixed into stdout), use stdout as stderr on non-zero exit so workflows can consistently read steps.<id>.output.stderr for errors. - Update README inline comment for force: wording to say 'when target directory already exists' rather than 'non-empty directory', matching the actual specify init behavior for the project: form. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d38ebe4 commit e8857ca

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/specify_cli/workflows/steps/init/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ def _run_init(
263263
try:
264264
stderr = result.stderr or ""
265265
except (ValueError, AttributeError):
266-
stderr = ""
266+
# Older Click: stderr is mixed into stdout. On failure, treat
267+
# stdout as stderr so workflows can consistently read
268+
# steps.<id>.output.stderr for error details.
269+
stderr = stdout if result.exit_code != 0 else ""
267270

268271
if result.exit_code != 0 and result.exception is not None:
269272
detail = f"{type(result.exception).__name__}: {result.exception}"

workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ and resolves the integration from the step config or the workflow default:
128128
integration: copilot # Optional: defaults to workflow integration
129129
integration_options: "--skills" # Optional: extra options for the integration
130130
script: sh # Optional: sh or ps
131-
force: true # Optional: required to merge into a non-empty directory
131+
force: true # Optional: required when target directory already exists
132132
preset: healthcare-compliance # Optional preset ID
133133
```
134134

0 commit comments

Comments
 (0)