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 #19068

merged 1 commit into from Mar 28, 2019


None yet
1 participant
Copy link

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


Possible Drawbacks

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

Verification Process

I copied the 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


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

2 checks passed

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

@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
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.