-
Notifications
You must be signed in to change notification settings - Fork 0
/
flutterfire-config.sh
42 lines (40 loc) · 1.6 KB
/
flutterfire-config.sh
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
41
42
#!/bin/bash
# Script to generate Firebase configuration files for different environments/flavors
# Feel free to reuse and adapt this script for your own projects
if [[ $# -eq 0 ]]; then
echo "Error: No environment specified. Use 'dev', 'stg', or 'prod'."
exit 1
fi
case $1 in
dev)
flutterfire config \
--project=gordon-ferguson-teaching-dev \
--out=lib/firebase_options_dev.dart \
--ios-bundle-id=org.gordonferguson.gordonfergusonteachingsapp.dev \
--ios-out=ios/flavors/development/GoogleService-Info.plist \
--android-package-name=gordonferguson.org.gordon_ferguson_teachings_app.dev \
--android-out=android/app/src/development/google-services.json
;;
stg)
flutterfire config \
--project=gordon-ferguson-teaching-dev \
--out=lib/firebase_options_stg.dart \
--ios-bundle-id=org.gordonferguson.gordonfergusonteachingsapp.stg \
--ios-out=ios/flavors/staging/GoogleService-Info.plist \
--android-package-name=gordonferguson.org.gordon_ferguson_teachings_app.stg \
--android-out=android/app/src/staging/google-services.json
;;
prod)
flutterfire config \
--project=gordon-ferguson-teachings \
--out=lib/firebase_options_prod.dart \
--ios-bundle-id=org.gordonferguson.gordonfergusonteachingsapp \
--ios-out=ios/flavors/production/GoogleService-Info.plist \
--android-package-name=gordonferguson.org.gordon_ferguson_teachings_app \
--android-out=android/app/src/production/google-services.json
;;
*)
echo "Error: Invalid environment specified. Use 'dev', 'stg', or 'prod'."
exit 1
;;
esac