Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell: Fix some cd returning the wrong exit code #11092

Merged
merged 2 commits into from
May 18, 2024

Conversation

zackradisic
Copy link
Contributor

What does this PR do?

Fixes #11084

cd was not returning the correct exit code when it failed with an error

This also adds tests for other builtins to make sure they fail with non-zero exit code

Copy link

failing_cmds.forEach(cmdstr =>
!!cmdstr
? TestBuilder.command`${{ raw: cmdstr }}`
.exitCode(c => c !== 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we test for a specific exit code here, to avoid unintentionally changing the exit code in the future?

Suggested change
.exitCode(c => c !== 0)
.exitCode(c => c === 1)

@Jarred-Sumner Jarred-Sumner merged commit 38122a9 into main May 18, 2024
47 of 52 checks passed
@Jarred-Sumner Jarred-Sumner deleted the zack/builtin-exit-codes branch May 18, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell execution continues after failed command
2 participants