Make sure version is fetched correctly

This commit is contained in:
topjohnwu 2024-07-25 03:04:24 -07:00
parent f601bf12d5
commit 939bfac920

View File

@ -87,8 +87,6 @@ update_release_json() {
} }
build_canary() { build_canary() {
enable_version_config
# Update version code # Update version code
local code=$(grep_prop magisk.versionCode $GCONFIG) local code=$(grep_prop magisk.versionCode $GCONFIG)
code=$((code + 1)) code=$((code + 1))
@ -119,14 +117,10 @@ build_canary() {
$BUILDCMD clean $BUILDCMD clean
$BUILDCMD all $BUILDCMD all
$BUILDCMD -r all $BUILDCMD -r all
disable_version_config
} }
# $1 = ver, $2 = stable? # $1 = ver, $2 = stable?
build_release() { build_release() {
enable_version_config
# Update version configs # Update version configs
local ver=$1 local ver=$1
local stable=$2 local stable=$2
@ -160,8 +154,6 @@ build_release() {
# Build # Build
$BUILDCMD clean $BUILDCMD clean
$BUILDCMD -r all $BUILDCMD -r all
disable_version_config
} }
stable() { stable() {
@ -238,6 +230,8 @@ fi
git pull git pull
trap disable_version_config EXIT
enable_version_config
case $1 in case $1 in
"canary" ) build_canary ;; "canary" ) build_canary ;;
"stable" ) stable $2 ;; "stable" ) stable $2 ;;