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

bug: npx cap sync does not return a non zero status on update failure #3592

Closed
dan-overton opened this issue Sep 22, 2020 · 4 comments
Closed

Comments

@dan-overton
Copy link

Bug Report

Capacitor Version

Latest Dependencies:

@capacitor/cli: 2.4.1
@capacitor/core: 2.4.1
@capacitor/android: 2.4.1
@capacitor/electron: 2.4.1
@capacitor/ios: 2.4.1

Installed Dependencies:

@capacitor/cli 2.4.1
@capacitor/android 2.4.1
@capacitor/core 2.4.1
@capacitor/ios 2.4.1
@capacitor/electron not installed

[success] Android looking great! 👌
Found 0 Capacitor plugins for ios:
[success] iOS looking great! 👌

Platform(s)

ios, android

Current Behavior

When running npx cap sync <platform>, if the update fails the command does not exit with a non zero status.
This means that our CI system thought the sync had completed successfully when in fact it had failed.
The subsequent iOS build failed as relevant cocoapods had not been installed.

Rerunning the build worked as the error was transient.

Relevant logging:

Screenshot 2020-09-22 at 11 59 02

Expected Behavior

The command should exit with a non zero status, so we can tell if the command errored in CI.

Code Reproduction

n/a

Other Technical Details

The exception that would show us the error is caught and not re-thrown at

logger.error(`Error running update:\n` + (e.stack ?? e));
(I think!)

@imhoffd
Copy link
Contributor

imhoffd commented Sep 22, 2020

I believe the current behavior is for when the command is run as npx cap sync and it syncs multiple platforms, but I think it makes more sense to fail early if any error is encountered.

Thanks for the report!

@dan-overton
Copy link
Author

No problem! Many thanks for taking a look at this so quickly.

@jcesarmobile
Copy link
Member

this was fixed on 2.4.2

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants