chore: tidy local debug scripts

This commit is contained in:
npc0-hue
2026-07-23 16:09:12 +08:00
parent c07994c417
commit 8cc741ba19
15 changed files with 86 additions and 42 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# shellcheck source=scripts/local-debug/env.sh
source "$ROOT_DIR/scripts/local-debug/env.sh"
case "$LOCAL_DEBUG_ROOT" in
"$ROOT_DIR/.local-debug" | /private/tmp/browser-local-debug-* | /tmp/browser-local-debug-*)
;;
*)
printf 'refusing to reset unexpected LOCAL_DEBUG_ROOT: %s\n' "$LOCAL_DEBUG_ROOT" >&2
printf 'allowed roots: %s/.local-debug, /private/tmp/browser-local-debug-*, /tmp/browser-local-debug-*\n' "$ROOT_DIR" >&2
exit 1
;;
esac
"$ROOT_DIR/scripts/dev-stop.sh"
printf 'deleting local debug root only: %s\n' "$LOCAL_DEBUG_ROOT"
rm -rf "$LOCAL_DEBUG_ROOT"
printf 'local debug reset complete\n'