-
Notifications
You must be signed in to change notification settings - Fork 147
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
fix(shorebird_cli): verify that validators can be run before running them #1254
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1254 +/- ##
=======================================
Coverage 98.93% 98.93%
=======================================
Files 179 179
Lines 4586 4590 +4
=======================================
+ Hits 4537 4541 +4
Misses 49 49
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear to me from reading this what the affect on the user is.
e.g. is this trying to communicate a programmer error (we're executing code we didn't mean to some place) or user error (you're trying to do an unsupported thing)?
Is this validator only ever run for shorebird release android
? Or is it also run for shorebird doctor
?
Relatedly, do we handle using shorebird without an android
directory at all? e.g. if you just wanted to use Shorebird on iOS?
@eseidel added an example screenshot to the description.
A helpful error message will be printed instead of a crash when a user runs an android command in a Flutter app/module directory that does not have android support.
Both.
Yes (or we should and it's a bug that we don't). This validator only is only run on android-specific commands, so it should not be invoked for anything iOS-related. |
Description
Updates
validatePreconditions
to check that validators can be run before running them. If a validator that cannot be run in the current context is provided, prints an error message/usage instructions and exits.Example:
Fixes #1253
Type of Change