-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathflutterfire_config.ps1
40 lines (37 loc) · 1.54 KB
/
flutterfire_config.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Script to generate Firebase configuration files for different environments/flavors
# Feel free to reuse and adapt this script for your own projects
param(
[string]$env = ""
)
if ($env -eq "") {
Write-Host "Error: No environment specified. Use 'dev', or 'prod'."
exit 1
}
switch ($env) {
"dev" {
flutterfire config `
--project=<YOUR_PROJECT_ID> `
--out=lib/firebase_options_dev.dart `
--ios-bundle-id=com.developer.fabian.crudTodoApp.dev `
--ios-out=ios/config/develop/GoogleService-Info.plist `
--android-package-name=com.developer.fabian.crud_todo_app.dev `
--android-out=android/app/src/develop/google-services.json `
--macos-bundle-id=com.developer.fabian.crudTodoApp.dev `
--macos-out=macos/config/develop/GoogleService-Info.plist
}
"prod" {
flutterfire config `
--project=<YOUR_PROJECT_ID> `
--out=lib/firebase_options.dart `
--ios-bundle-id=com.developer.fabian.crudTodoApp `
--ios-out=ios/config/production/GoogleService-Info.plist `
--android-package-name=com.developer.fabian.crud_todo_app `
--android-out=android/app/src/production/google-services.json `
--macos-bundle-id=com.developer.fabian.crudTodoApp `
--macos-out=macos/config/production/GoogleService-Info.plist
}
default {
Write-Error "Error: Invalid environment specified. Use 'dev', or 'prod'."
exit 1
}
}