#!/usr/bin/env bash
# Run once per checkout, with the same packaged version and clean state.
# Arguments: checkout output-directory scratch-directory side
set -euo pipefail
repo=$1
package=$2
scratch=$3
side=$4
cd "$repo"
vp i
TMPDIR="$scratch" vp run dist:desktop:artifact --platform linux --target dir --arch x64 --build-version 0.1.9 --output-dir "$package" --mock-updates
# Select the normal Linux .deb updater in this unpacked production package.
printf deb > "$package/linux-unpacked/resources/package-type"
T3CODE_DEV_SEED=0 headless-desktop node "$scratch/desktop-proof.cjs" "$repo" "$package/linux-unpacked/t3code" "$side" "$scratch"
# Additional runs: MODE=drop for a dropped connection; ENTRY=sidebar for the sidebar action.
