#!/bin/bash
set -euo pipefail
checkout=$1
state=$2
workspace="$state/workspace"
mkdir -p "$workspace"
git -C "$workspace" init -q -b main
printf 'Image preview reproduction\n' > "$workspace/README.md"
git -C "$workspace" add README.md
git -C "$workspace" -c user.name=Example -c user.email=example@example.invalid commit -qm 'Initial commit'
git -C "$workspace" remote add origin https://github.com/pingdotgg/t3code.git
cd "$checkout"
node apps/server/src/bin.ts project add "$workspace" --title 'Image preview' --base-dir "$state"
