Skip to content

Commit 6093d2b

Browse files
committed
build: fix android version naming
1 parent 42bcda6 commit 6093d2b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/android.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
usage="Usage: android.sh [type] [platform|version]\n - type: 'build', 'release'\n - platform, for 'build' type: 'v7', 'v8', 'x86'\n - optional version for 'release' (needed on MacOS), example: '0.2.2'"
3+
usage="Usage: android.sh [type] [platform|version]\n - type: 'build', 'release'\n - platform, for 'build' type: 'v7', 'v8', 'x86'\n - version for 'release', example: '0.2.2'"
44
case $1 in
55
build|release)
66
;;
@@ -81,10 +81,10 @@ function build_apk() {
8181
adb -s "$SERIAL" shell am start -n mw.gri.android/.MainActivity;
8282
done
8383
else
84-
if [[ "$OSTYPE" != "darwin"* ]]; then
85-
version=$(grep -m 1 -Po 'version = "\K[^"]*' Cargo.toml)
86-
else
87-
version=v$2
84+
# Get version
85+
version=v$2
86+
if [[ -z "$version" ]]; then
87+
version=$(grep -m 1 -Po 'version = "\K[^"]*' ../Cargo.toml)
8888
fi
8989
# Setup release file name
9090
name=grim-${version}-android-$1.apk

0 commit comments

Comments
 (0)