docs: a PowerShell script needs one more line, or a failed run reports success - #40
Merged
Conversation
…s success Measured on 2026-09-02, in both Windows PowerShell 5.1 and pwsh 7: tfg with a bad flag returns 2 when it is run directly, and the same call wrapped in a .ps1 run with -File makes the script answer 0. Adding exit $LASTEXITCODE brings the 2 back. That is PowerShell rather than this tool - a script does not inherit the exit code of the last program it ran. But .ps1 is the ordinary wrapper on Windows, and this tool is meant to be wired into CI, so a person following the exit code table would get a green build on a run that refused the work. The CI section now says so and shows the line. cmd, bash and zsh need nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…recipe Measured on 2026-09-02: a recipe kept in recipes/ with dir: out, run from somewhere else, writes into out beside the caller rather than beside the recipe. The behaviour has been the same since the beginning and was written down nowhere, so the first person keeping recipes in their own directory had to find it by looking for the files. The key table now says it, with the way to pin it down. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while building the pre-release ritual, and it is a fact about the people
who use this tool rather than about the tool.
Measured
Both Windows PowerShell 5.1 and pwsh 7, exit code read from the process rather
than from
echo $?:tfg --bad-flagdirectly.ps1, run with-File.ps1ending withexit $LASTEXITCODEA
.ps1does not inherit the exit code of the last program it ran. That isPowerShell, not this tool - but
.ps1is the ordinary wrapper on Windows, andthis tool is built to be wired into CI. Somebody following the exit code table
in the README would get a green build on a run that refused the work, which is
the silent failure this project forbids everywhere else.
What changes
One subsection in the CI part of the README, with the line that fixes it. No
code changes - this cannot be fixed from our side, because the script's exit
code belongs to the shell.
cmd,bashandzshneed nothing extra, and the README says that too.Recorded as
O172, and the pre-release ritual already defends against it: every.ps1it generates ends withexit $LASTEXITCODE, or it would be measuringPowerShell instead of the program.
🤖 Generated with Claude Code