mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
script updates and new run-android script (#1396)
This commit is contained in:
parent
e6b4b08c24
commit
e48962361a
2 changed files with 31 additions and 11 deletions
30
run-android.sh
Executable file
30
run-android.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Get the current git branch
|
||||
get_current_branch() {
|
||||
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
echo "$branch"
|
||||
else
|
||||
echo "Error: Not a git repository."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Update the app.properties file
|
||||
update_app_properties() {
|
||||
local branch=$1
|
||||
local file_path="./android/app.properties"
|
||||
|
||||
sed -i "s/^id=.*/id=com.cakewallet.$branch/" "$file_path"
|
||||
sed -i "s/^name=.*/name=$branch-Cake Wallet/" "$file_path"
|
||||
}
|
||||
|
||||
# only update app.properties if getting the current branch was successful
|
||||
current_branch=$(get_current_branch)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
update_app_properties "$current_branch"
|
||||
fi
|
||||
|
||||
# run the app
|
||||
flutter run
|
Loading…
Add table
Add a link
Reference in a new issue