#!/usr/bin/env bash # Creates the builder's sparse worktree: everything shared, its own app # directory, and nothing of the reference fixture or other apps. # builders/worktree.sh set -euo pipefail slug=$1 repo=$(cd "$(dirname "$0")/.." && pwd) wt="$repo/.worktrees/$slug" cd "$repo" git worktree add --no-checkout -b "app/$slug" "$wt" HEAD cd "$wt" git sparse-checkout set --no-cone '/*' '!/harness/refapp/' '!/apps/' "/apps/$slug/" '/apps/.keep' git checkout -q mkdir -p "apps/$slug" echo "$wt"