#!/usr/bin/env bash
# Run as the synthetic remote SSH user, with Node matching the checkout's engine.
set -euo pipefail
checkout=$1
data_home=$2
workspace=$3
mkdir -p "$workspace"
git -C "$workspace" init -q -b main
: > "$workspace/README.md"
git -C "$workspace" add README.md
git -C "$workspace" -c user.name=Demo -c user.email=demo@example.invalid commit -q -m 'Demo workspace'
printf '# Remote workspace\n\nA synthetic repository for editor connection verification.\n' > "$workspace/README.md"
cd "$checkout"
node apps/server/src/bin.ts project add "$workspace" --title 'SSH route demo' --base-dir "$data_home"
