react-native-bspatch 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tools/upload_ota.sh +9 -5
package/package.json
CHANGED
package/tools/upload_ota.sh
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
ROOT_DIR=$(pwd)
|
|
11
11
|
|
|
12
12
|
BASE_URL="${OTA_BASE_URL:-}"
|
|
13
|
-
BASE_FOLDER="${OTA_FOLDER
|
|
13
|
+
BASE_FOLDER="${OTA_FOLDER:-ota}"
|
|
14
14
|
APP_VERSION="$1"
|
|
15
15
|
CHANNEL="$2"
|
|
16
16
|
OTA_VERSION="$3"
|
|
@@ -26,7 +26,7 @@ fi
|
|
|
26
26
|
|
|
27
27
|
# Validate
|
|
28
28
|
if [[ -z "$APP_VERSION" || -z "$OTA_VERSION" ]]; then
|
|
29
|
-
echo "Usage: $0 <app_version> <channel> <ota_version> <bundle_path> [platform] [
|
|
29
|
+
echo "Usage: $0 <app_version> <channel> <ota_version> <bundle_path> [platform] [--clean-remote]"
|
|
30
30
|
exit 1
|
|
31
31
|
fi
|
|
32
32
|
if [[ ! -f "$REGISTRY_FILE" ]]; then
|
|
@@ -67,11 +67,15 @@ if [[ -n "${OTA_R2_BUCKET:-}" ]]; then
|
|
|
67
67
|
|
|
68
68
|
echo " → Cloudflare R2: $OTA_R2_BUCKET/$RELEASE_PREFIX"
|
|
69
69
|
if [ "$CLEAN_REMOTE" = true ]; then
|
|
70
|
-
echo "
|
|
70
|
+
echo " Deleting $RELEASE_PREFIX/ ..."
|
|
71
71
|
# ponytail: one ListObjectsV2 page (1000 keys); a release+channel holds far fewer
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
LISTING=$(r2 -f "$R2_URL?list-type=2&prefix=$RELEASE_PREFIX/") || { echo " ❌ Listing $RELEASE_PREFIX/ failed"; exit 1; }
|
|
73
|
+
DELETED=0
|
|
74
|
+
for KEY in $(echo "$LISTING" | grep -o '<Key>[^<]*</Key>' | sed 's/<[^>]*>//g'); do
|
|
75
|
+
r2 -f -X DELETE "$R2_URL/$KEY" -o /dev/null || { echo " ❌ Delete failed: $KEY"; exit 1; }
|
|
76
|
+
echo " ✗ $KEY"; DELETED=$((DELETED + 1))
|
|
74
77
|
done
|
|
78
|
+
echo " ✓ $DELETED object(s) deleted"
|
|
75
79
|
else
|
|
76
80
|
# Only this version's files: earlier bundles/patches are already uploaded and never change
|
|
77
81
|
RELEASE_FILES=()
|