Skip to content

Commit 86333ab

Browse files
authored
Populate exit_code/stdout/stderr in non-empty-dir fast-fail
1 parent 5673df8 commit 86333ab

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ def execute(self, config: dict[str, Any], context: StepContext) -> StepResult:
104104
except OSError:
105105
not_empty = False
106106
if not_empty:
107+
error_message = (
108+
f"Target directory {base!r} is not empty. Set "
109+
"'force: true' to merge into a non-empty directory."
110+
)
107111
return StepResult(
108112
status=StepStatus.FAILED,
109113
output={
@@ -112,11 +116,11 @@ def execute(self, config: dict[str, Any], context: StepContext) -> StepResult:
112116
"here": here,
113117
"integration": integration,
114118
"script": script,
119+
"exit_code": 1,
120+
"stdout": "",
121+
"stderr": error_message,
115122
},
116-
error=(
117-
f"Target directory {base!r} is not empty. Set "
118-
"'force: true' to merge into a non-empty directory."
119-
),
123+
error=error_message,
120124
)
121125

122126
if integration:

0 commit comments

Comments
 (0)