Skip to content

Commit

Permalink
feat: add mason template
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyokone committed Jul 18, 2022
1 parent ffa3efb commit 958e92c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
3 changes: 2 additions & 1 deletion packages/flutterfire_cli/lib/src/command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

import 'package:args/command_runner.dart';

import 'commands/config.dart';
import 'common/utils.dart';
import 'flutter_app.dart';
Expand All @@ -27,7 +28,7 @@ import 'flutter_app.dart';
/// ```dart
/// final flutterFire = FlutterFireCommandRunner();
///
/// await FlutterFireCommandRunner.run(['config']);
/// await flutterFire.run(['config']);
/// ```
class FlutterFireCommandRunner extends CommandRunner<void> {
FlutterFireCommandRunner(FlutterApp? flutterApp)
Expand Down
8 changes: 5 additions & 3 deletions packages/flutterfire_cli/lib/src/commands/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

import 'dart:io';

import 'package:ansi_styles/ansi_styles.dart';
import 'package:path/path.dart' as path;

Expand All @@ -32,7 +33,6 @@ import '../firebase/firebase_options.dart';
import '../firebase/firebase_project.dart';
import '../firebase/firebase_web_options.dart';
import '../flutter_app.dart';

import 'base.dart';

class ConfigCommand extends FlutterFireCommand {
Expand Down Expand Up @@ -455,7 +455,8 @@ class ConfigCommand extends FlutterFireCommand {
if (generateAppIdJson) {
if (iosOptions != null) {
final appIDFile = FirebaseAppIDFile(
iosAppIDOutputFilePrefix,
// In order to generate if we're not in the folder of the flutterApp
flutterApp?.iosDirectory.path ?? iosAppIDOutputFilePrefix,
options: iosOptions,
force: isCI || yes,
);
Expand All @@ -464,7 +465,8 @@ class ConfigCommand extends FlutterFireCommand {

if (macosOptions != null) {
final appIDFile = FirebaseAppIDFile(
macosAppIDOutputFilePrefix,
// In order to generate if we're not in the folder of the flutterApp
flutterApp?.macosDirectory.path ?? macosAppIDOutputFilePrefix,
options: macosOptions,
force: isCI || yes,
);
Expand Down
16 changes: 5 additions & 11 deletions packages/flutterfire_starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@

[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason)

A new brick created with the Mason CLI.
A new template to quickly start with FlutterFire

_Generated by [mason][1] 🧱_

## Getting Started 🚀

This is a starting point for a new brick.
A few resources to get you started if this is your first brick template:
You need to install `flutterfire_cli`

- [Official Mason Documentation][2]
- [Code generation with Mason Blog][3]
- [Very Good Livestream: Felix Angelov Demos Mason][4]

[1]: https://github.com/felangel/mason
[2]: https://github.com/felangel/mason/tree/master/packages/mason_cli#readme
[3]: https://verygood.ventures/blog/code-generation-with-mason
[4]: https://youtu.be/G4PTjA6tpTU
```
dart pub global activate flutterfire_cli
```

0 comments on commit 958e92c

Please sign in to comment.