Skip to content

Commit 361ef6d

Browse files
committed
fix: depend on target branch
1 parent 7c95008 commit 361ef6d

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

scripts/ota.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,20 @@ _push_ota_info() {
2121
fi
2222
cd "${ROM_DIR}"_ota || exit
2323
git init
24-
git pull "${OTA_REPO_URL}" "${ROM_BRANCH}"
24+
25+
# Specify a fallback, so that roms, that purely rely on android numbers do not collide
26+
if [[ -n "${ROM_OTA_BRANCH_FALLBACK}" ]]; then
27+
target_ota_branch="${ROM_OTA_BRANCH_FALLBACK}"
28+
else
29+
target_ota_branch="${ROM_BRANCH}"
30+
fi
31+
32+
# Append extraversion to avoid collision of different flavours
33+
if [[ -n "${ROM_EXTRAVERSION}" ]]; then
34+
target_ota_branch="${target_ota_branch}"-"$(tr --delete '-' <<< "${ROM_EXTRAVERSION,,}")"
35+
fi
36+
37+
git pull "${OTA_REPO_URL}" "${target_ota_branch}"
2538
2639
cp "${OUT}"/"${PACKAGE_NAME}".json "${ROM_DIR}"_ota/"${TARGET_DEVICE}".json
2740
git add "${ROM_DIR}"_ota/"${TARGET_DEVICE}".json
@@ -36,18 +49,6 @@ _push_ota_info() {
3649
_cleanup_fail
3750
fi
3851
39-
# Specify a fallback, so that roms, that purely rely on android numbers do not collide
40-
if [[ -n "${ROM_OTA_BRANCH_FALLBACK}" ]]; then
41-
target_ota_branch="${ROM_OTA_BRANCH_FALLBACK}"
42-
else
43-
target_ota_branch="${ROM_BRANCH}"
44-
fi
45-
46-
# Append extraversion to avoid collision of different flavours
47-
if [[ -n "${ROM_EXTRAVERSION}" ]]; then
48-
target_ota_branch="${target_ota_branch}"-"$(tr --delete '-' <<< "${ROM_EXTRAVERSION,,}")"
49-
fi
50-
5152
if [[ -n "${target_ota_repo_url}" ]]; then
5253
git push "${target_ota_repo_url}" HEAD:"${target_ota_branch}"
5354
fi

0 commit comments

Comments
 (0)