Files
extendedMediaForwards/scripts/deploy.sh
T
exteraGramPlugins bfd0f80c6f Initial commit
2026-09-24 20:23:49 +00:00

37 lines
822 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
source scripts/lib.sh
need_cmd "$PY"
MODE=--dev
ENABLE=0
CONNECT=1
for arg in "$@"; do
case "$arg" in
--release) MODE=--release ;;
--enable) ENABLE=1 ;;
--no-connect) CONNECT=0 ;;
*) die "unknown argument: $arg" ;;
esac
done
"$PY" tools/bundle.py "$MODE" --out dist
BUNDLE="dist/${PLUGIN_ID}.plugin"
[[ -f "$BUNDLE" ]] || die "expected bundle not found at $BUNDLE"
echo "bundle: $BUNDLE ($(stat -c '%s' "$BUNDLE" 2>/dev/null || stat -f '%z' "$BUNDLE") bytes)"
if [[ "$CONNECT" -eq 1 ]]; then
need_cmd "$ADB"
scripts/adb-connect.sh
fi
DEPLOY_ARGS=(deploy "$BUNDLE" --id "$PLUGIN_ID")
if [[ "$ENABLE" -eq 1 ]]; then
DEPLOY_ARGS+=(--enable)
fi
"$PY" tools/devclient.py "${DEPLOY_ARGS[@]}"