Files
alan ea428d3c98 Add generic capture kit and repo-owned test memory watchdog
app/tool/capture: one Chrome DevTools capture CLI over the full-app fixture
(serve build or URL, private headless Chrome or --cdp attach, label/key/xy
clicks via Flutter semantics, type, press, scroll, screenshots, filmed
clicks with a canvas contact sheet, cleanup on exit/signal), README recipes
and an example script. The fixture entry gains ?theme=light|dark.

app/tool/memwatch: run.sh/full.sh watchdog moved from /tmp (output dir
created if missing, exit status propagated) plus install.sh for the legacy
/tmp/memwatch shims. app/AGENTS.md points tests at full.sh and UI review at
the capture kit.
2026-11-01 21:22:08 +00:00

29 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Points the legacy /tmp/memwatch/{run,full}.sh at the repo scripts, so older
# instructions keep working after /tmp is cleared (reboot). Each shim prefers
# the main clone's copy and falls back to the copy this was installed from (a
# worktree may be removed later). Shims are replaced atomically, so a run that
# is already executing the old file is unaffected.
#
# Usage: app/tool/memwatch/install.sh
set -eu
here=$(cd "$(dirname "$0")" && pwd)
common=$(git -C "$here" rev-parse --path-format=absolute --git-common-dir)
main="$(dirname "$common")/app/tool/memwatch"
dir=${MEMWATCH_DIR:-/tmp/memwatch}
mkdir -p "$dir"
for name in run full; do
tmp=$(mktemp "$dir/.$name.XXXXXX")
cat > "$tmp" <<EOF
#!/bin/bash
# Shim installed by app/tool/memwatch/install.sh; the repo script is the source.
for d in "$main" "$here"; do
[ -x "\$d/$name.sh" ] && exec "\$d/$name.sh" "\$@"
done
echo "memwatch: $name.sh not found in $main or $here" >&2; exit 127
EOF
chmod +x "$tmp"
mv -f "$tmp" "$dir/$name.sh"
done
echo "$dir/{run,full}.sh -> $main (fallback $here)"