#!/usr/bin/env bash
set -euo pipefail
# Run from the scenario checkout; the fixture directory must have no spaces.
fixture_dir=$(mktemp -d)
git clone --quiet https://github.com/akinomyoga/ble.sh.git "$fixture_dir/ble"
git -C "$fixture_dir/ble" checkout --quiet 1529427
make -s -C "$fixture_dir/ble"
printf "export PS1='demo\$ '\nsource %q\n" "$fixture_dir/ble/out/ble.sh" > "$fixture_dir/bashrc"
printf '#!/bin/sh\nexec /bin/bash --noprofile --rcfile %s -i "$@"\n' "$fixture_dir/bashrc" > "$fixture_dir/bash"
chmod +x "$fixture_dir/bash"
export SHELL="$fixture_dir/bash" T3CODE_DEV_SEED=0 T3_SCENARIO_INHERIT_ENV=SHELL,T3CODE_DEV_SEED
vp run scenarios:prove scripts/scenarios/setup-shell-editor.e2e.ts --base 2f2730c11347ec17f5d0136b1158da6b641ddc61 --head d1c9df20f924cad5dd80d500954d3763de6f6423 --upload-command 'ghdrop upload'
