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

fix(shorebird_cli): don't run flutter pub get after build if flutter is not installed #1447

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

bryanoltman
Copy link
Contributor

Description

Checks for the presence of flutter on the user's path before attempting to run flutter pub get after a build.

For context: flutter pub get is run after a build to reset .dart_tool/package_config.json to point to the system flutter install instead of the shorebird flutter install. This value is set when running a flutter build command or flutter pub get.

Fixes #1430

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1a1ac60) 100.00% compared to head (46e058b) 100.00%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1447   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          151       151           
  Lines         4579      4580    +1     
=========================================
+ Hits          4579      4580    +1     
Flag Coverage Δ
shorebird_cli 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...s/shorebird_cli/lib/src/shorebird_build_mixin.dart 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -277,6 +278,12 @@ mixin ShorebirdBuildMixin on ShorebirdCommand {
/// https://github.com/shorebirdtech/shorebird/issues/1101 for more info.
Future<void> _systemFlutterPubGet() async {
const executable = 'flutter';
if (osInterface.which(executable) == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really need to get rid of this mixin so we can avoid having to duplicate the tests 🤣

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this PR is a case study re: why we shouldn't use mixins for any functionality we want to test :)

@bryanoltman bryanoltman merged commit 3d07a33 into main Nov 7, 2023
8 checks passed
@bryanoltman bryanoltman deleted the bo/no-path-flutter branch November 7, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"flutter pub get failed to run after the build completed" prints if Flutter is not installed
2 participants