Skip to content

Check for both Firebase CLIs before configuring, and say how to install them - #20

Merged
seenu-k merged 1 commit into
mainfrom
fix/configure-firebase-preflight
Aug 7, 2026
Merged

Check for both Firebase CLIs before configuring, and say how to install them#20
seenu-k merged 1 commit into
mainfrom
fix/configure-firebase-preflight

Conversation

@seenu-k

@seenu-k seenu-k commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Hit while configuring a freshly scaffolded game:

configure_firebase: could not find `flutterfire`. Install the Firebase and FlutterFire CLIs, then run this command again.

firebase was 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, and dart pub global activate puts it in a directory that is not on PATH by default. "Install both CLIs" is the least useful thing to say to someone who has one of them.

Now:

configure_firebase: could not find `flutterfire`. Install it with:

  dart pub global activate flutterfire_cli
  …and put Dart's global bin directory on your PATH (~/.pub-cache/bin on macOS and Linux)

Then run this command again.

Checked up front rather than on use

firebase is not reached until FlutterFire has already written firebase.json and lib/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 ProcessException handler 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 firebase on a trimmed PATH and asserts exit 69, that the message names flutterfire and 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 analyze clean, both tests pass. CHANGELOG.md has an [Unreleased] entry via cider log.

🤖 Generated with Claude Code

…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>
@seenu-k
seenu-k merged commit 8f8be67 into main Aug 7, 2026
3 checks passed
@seenu-k
seenu-k deleted the fix/configure-firebase-preflight branch August 7, 2026 01:34
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.

1 participant