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

Preserve Atom's exit code in atom.sh #19068

Merged
merged 1 commit into from Mar 28, 2019

Conversation

Projects
None yet
1 participant
@smashwilson
Copy link
Member

commented Mar 28, 2019

Requirements for Contributing a Bug Fix

Identify the Bug

When running atom --test from the command line, a zero exit code is overwritten to be 1 by a conditional. This causes successful test runs to always exit as a failure. This is a regression caused by #19028.

Description of the Change

The root cause of the problem is that bash's $? variable is overwritten by the test command used to check for an exit code override. By capturing $? immediately after the atom command returns, we can report it correctly.

Alternate Designs

N/A

Possible Drawbacks

There's some duplication between the MacOS and Linux branches in atom.sh. Not sure if it's worth addressing now though.

Verification Process

I copied the atom.sh script over /usr/local/bin/atom-nightly, ran atom-nightly --test test/ in the GitHub package source, and verified that it exited with a 0 status instead of a 1.

Release Notes

N/A

@smashwilson smashwilson merged commit 7a6e4fd into master Mar 28, 2019

2 checks passed

Atom Pull Requests #20190328.1 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@smashwilson smashwilson deleted the aw/preserve-exit-code branch Mar 28, 2019

smashwilson added a commit that referenced this pull request Mar 28, 2019

Merge pull request #19068 from atom/aw/preserve-exit-code
Preserve Atom's exit code in atom.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.