#!/usr/bin/env bash
# Reproduction recipe. This capture used the existing worktree dependencies; no vp install or extra worktree.
set -euo pipefail
mkdir -p /tmp/lead-33587-r1/capture-2
# Check the threshold before each install; do not continue below 5 GB available.
df -BG --output=avail /
npm install --prefix /tmp/lead-33587-r1/capture-2/tool-cache/current --no-fund --no-audit agent-device@0.21.31
df -BG --output=avail /
npm install --prefix /tmp/lead-33587-r1/capture-2/tool-cache/older --no-fund --no-audit agent-device@0.21.30
df -BG --output=avail /
npm install --prefix /tmp/lead-33587-r1/capture-2/tool-cache/hub --no-fund --no-audit expo-device-hub@0.19.1
mkdir -p /tmp/lead-33587-r1/capture-2/android-sdk
cp -al /home/ubuntu/Android/Sdk/licenses /tmp/lead-33587-r1/capture-2/android-sdk/licenses
ln -s /home/ubuntu/Android/Sdk/platform-tools /tmp/lead-33587-r1/capture-2/android-sdk/platform-tools
ln -s /home/ubuntu/Android/Sdk/cmdline-tools /tmp/lead-33587-r1/capture-2/android-sdk/cmdline-tools
df -BG --output=avail /
/home/ubuntu/Android/Sdk/cmdline-tools/latest/bin/sdkmanager --sdk_root=/tmp/lead-33587-r1/capture-2/android-sdk emulator
# Run capture-driver.mjs after <fixture> for every fixture before changing source files.
# Then use the exact two baseline substitutions from the brief, and run before <fixture>.
# Finally restore the two runtime files with git checkout -- and verify clean HEAD.
