Check for both Firebase CLIs before configuring, and say how to install them - #20
Merged
Merged
Conversation
…ll them `could not find \`flutterfire\`. Install the Firebase and FlutterFire CLIs` named the missing tool but not how to get it, and pointed at both when the reader typically has one. FlutterFire is the usual casualty: it is not installed alongside Flutter, and `dart pub global activate` puts it in a directory that is not on PATH by default — so the message now carries the activate command and the PATH note, and only for what is actually missing. Both tools are checked before anything runs. `firebase` was not needed until FlutterFire had already written firebase.json and lib/firebase_options.dart, so discovering it was missing at that point left a half-configured app. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hit while configuring a freshly scaffolded game:
firebasewas already installed. FlutterFire was the missing one, and the message neither said so nor gave the command — which matters here more than usual, because FlutterFire does not come with Flutter, anddart pub global activateputs it in a directory that is not onPATHby default. "Install both CLIs" is the least useful thing to say to someone who has one of them.Now:
Checked up front rather than on use
firebaseis not reached until FlutterFire has already writtenfirebase.jsonandlib/firebase_options.dart, so finding out then that it is missing leaves a half-configured app. Both tools are probed before anything runs. The probe ignores exit status — anything other than "no such executable" means the tool is installed, and whatever is wrong with it is better reported by the command that actually needs it.The old
ProcessExceptionhandler stays as a fallback for a tool that disappears between the check and its use, and now shares the same message.Tests
A new case runs the script with a fake
firebaseon a trimmedPATHand asserts exit 69, that the message namesflutterfireand carries the activate command, and that the tool the reader does have stays out of it. The existing end-to-end case is unaffected.dart analyzeclean, both tests pass.CHANGELOG.mdhas an[Unreleased]entry viacider log.🤖 Generated with Claude Code