mirror of
https://github.com/atom/atom.git
synced 2026-01-25 23:08:18 -05:00
Merge pull request #19068 from atom/aw/preserve-exit-code
Preserve Atom's exit code in atom.sh
This commit is contained in:
10
atom.sh
10
atom.sh
@@ -136,10 +136,11 @@ if [ $OS == 'Mac' ]; then
|
||||
|
||||
if [ $EXPECT_OUTPUT ]; then
|
||||
"$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@"
|
||||
if [ $? -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then
|
||||
ATOM_EXIT=$?
|
||||
if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then
|
||||
exit "${EXIT_CODE_OVERRIDE}"
|
||||
else
|
||||
exit $?
|
||||
exit ${ATOM_EXIT}
|
||||
fi
|
||||
else
|
||||
open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@"
|
||||
@@ -169,10 +170,11 @@ elif [ $OS == 'Linux' ]; then
|
||||
|
||||
if [ $EXPECT_OUTPUT ]; then
|
||||
"$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@"
|
||||
if [ $? -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then
|
||||
ATOM_EXIT=$?
|
||||
if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then
|
||||
exit "${EXIT_CODE_OVERRIDE}"
|
||||
else
|
||||
exit $?
|
||||
exit ${ATOM_EXIT}
|
||||
fi
|
||||
else
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user