37 lines
1005 B
Bash
Executable File
37 lines
1005 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Push Addressables tile bundles built under ServerData/TileBundles/<BuildTarget>
|
|
# into Android persistentDataPath for the app.
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
BUILD_TARGET="${1:-Android}"
|
|
PACKAGE_NAME="${PACKAGE_NAME:-com.dtrierflood.dtrierflood}"
|
|
SRC_DIR="$ROOT_DIR/ServerData/TileBundles/$BUILD_TARGET"
|
|
DST_DIR="/sdcard/Android/data/$PACKAGE_NAME/files/TileBundles/$BUILD_TARGET"
|
|
|
|
if [[ ! -d "$SRC_DIR" ]]; then
|
|
echo "Source bundle folder not found: $SRC_DIR" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v adb >/dev/null 2>&1; then
|
|
echo "adb not found in PATH" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Using source: $SRC_DIR"
|
|
echo "Using destination: $DST_DIR"
|
|
|
|
adb start-server >/dev/null
|
|
adb devices
|
|
|
|
# Ensure destination exists and clear old content for clean catalog/bundle set
|
|
adb shell "mkdir -p '$DST_DIR'"
|
|
adb shell "rm -rf '$DST_DIR'/*"
|
|
|
|
adb push "$SRC_DIR/." "$DST_DIR/"
|
|
|
|
echo "Done. Listing destination:"
|
|
adb shell "ls -lah '$DST_DIR' | head -n 50"
|