Skip to content

Commit

Permalink
fix: Added GitIgnore settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Jan 15, 2024
1 parent 18243b5 commit 3a31e02
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/katana_cli/lib/action/firebase/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,21 @@ class FirebaseInitCliAction extends CliCommand with CliActionMixin {
gradle.android?.defaultConfig.minSdkVersion =
"configProperties[\"flutter.minSdkVersion\"]";
await gradle.save();
label("Rewrite `.gitignore`.");
final gitignore = File("firebase/.gitignore");
if (!gitignore.existsSync()) {
error("Cannot find `firebase/.gitignore`. Project is broken.");
return;
}
final gitignores = await gitignore.readAsLines();
if (context.yaml.getAsMap("git").get("ignore_secure_file", true)) {
if (!gitignores.any((e) => e.startsWith(".env"))) {
gitignores.add(".env");
}
} else {
gitignores.removeWhere((e) => e.startsWith(".env"));
}
await gitignore.writeAsString(gitignores.join("\n"));
await command(
"Run firebase deploy",
[
Expand Down

0 comments on commit 3a31e02

Please sign in to comment.