Files
chatSummaries/scripts/lib.sh
T
exteraGramPlugins a3b0b264c1 Initial commit
2026-09-12 02:03:47 +00:00

27 lines
634 B
Bash

# Shared helpers for scripts/*.sh. Source, do not execute:
# source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PKG=com.exteragram.messenger
DEV_PORT=42690
DEBUG_PORT=5678
PY="${PYTHON:-python3}"
ADB="${ADB:-adb}"
PLUGIN_ID="$("$PY" -c "import json,sys; print(json.load(open(sys.argv[1]))['id'])" "$REPO_ROOT/plugin.json")"
die() {
echo "error: $*" >&2
exit 1
}
need_cmd() {
for cmd in "$@"; do
command -v "$cmd" >/dev/null 2>&1 || die "required command not found on PATH: $cmd"
done
}
app_pid() {
"$ADB" shell pidof -s "$PKG" | tr -d '\r'
}