script updates and new run-android script (#1396)
Matthew Fosse committed
Apr 18, 2024 at 11:10 UTC
e48962361a71888cb1c25d75204359ab2a660686
2 files changed
+31
-11
configure_cake_wallet.sh
+1
-11
@@ -23,14 +23,4 @@ source ./app_env.sh cakewallet
23
./app_config.sh
24
cd ../.. && flutter pub get
25
flutter packages pub run tool/generate_localization.dart
26
-cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
27
-cd cw_evm && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
28
-cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
29
-cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
30
-cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
31
-cd cw_nano && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
32
-cd cw_bitcoin_cash && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
33
-cd cw_solana && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
34
-cd cw_ethereum && flutter pub get && cd ..
35
-cd cw_polygon && flutter pub get && cd ..
36
-flutter packages pub run build_runner build --delete-conflicting-outputs
26
+./model_generator.sh
run-android.sh
new
+30
@@ -0,0 +1,30 @@
1
+#!/bin/bash
2
+
3
+# Get the current git branch
4
+get_current_branch() {
5
+ if git rev-parse --git-dir > /dev/null 2>&1; then
6
+ branch=$(git rev-parse --abbrev-ref HEAD)
7
+ echo "$branch"
8
+ else
9
+ echo "Error: Not a git repository."
10
+ return 1
11
+ fi
12
+}
13
+
14
+# Update the app.properties file
15
+update_app_properties() {
16
+ local branch=$1
17
+ local file_path="./android/app.properties"
18
+
19
+ sed -i "s/^id=.*/id=com.cakewallet.$branch/" "$file_path"
20
+ sed -i "s/^name=.*/name=$branch-Cake Wallet/" "$file_path"
21
+}
22
+
23
+# only update app.properties if getting the current branch was successful
24
+current_branch=$(get_current_branch)
25
+if [[ $? -eq 0 ]]; then
26
+ update_app_properties "$current_branch"
27
+fi
28
+
29
+# run the app
30
+flutter run
\ No newline at end of file