_From @cincuranet on October 19, 2016 6:10_
I'm trying to script whole build-test-stage-publish process using Ionic 2, but it's really difficult because running i.e. ionic build ios always returns 0.
It should return some non-zero exit code when some error occurred.
_Copied from original issue: driftyco/ionic#8791_
An example.

The xcodebuild ended with 65, while the ionic build ios returned still 0 (and hence everything looked fine).
I faced the same issue when I want to automate the build process. In my case there was a weired error in the lint step that made the build to exit with an error but it was treated as OK and the CI uploaded an empty app.
I use travis as CI, did an ionic build in the script step and an ionic upload in after_success so it should not upload anything when anything happen that makes the build not finishing completely.
Is the problem simply that the exit code of the app-script is not forwarded to npm ?
When is planned to fix that?
+1
+1
We're using TFS to automate builds and have the same problem. If there is an error in the build process, the exit code is always 0 and therefore the build status is always "Build succeeded" even if it fails.
Please fix this issue asap.
+1
This is not an issue with the latest CLI.
Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.
Thank you for using Ionic!