Download this file
| 1 | #!/usr/bin/env bash |
| 2 | # Creates the builder's sparse worktree: everything shared, its own app |
| 3 | # directory, and nothing of the reference fixture or other apps. |
| 4 | # builders/worktree.sh <slug> |
| 5 | set -euo pipefail |
| 6 | slug=$1 |
| 7 | repo=$(cd "$(dirname "$0")/.." && pwd) |
| 8 | wt="$repo/.worktrees/$slug" |
| 9 | cd "$repo" |
| 10 | git worktree add --no-checkout -b "app/$slug" "$wt" HEAD |
| 11 | cd "$wt" |
| 12 | git sparse-checkout set --no-cone '/*' '!/harness/refapp/' '!/apps/' "/apps/$slug/" '/apps/.keep' |
| 13 | git checkout -q |
| 14 | mkdir -p "apps/$slug" |
| 15 | echo "$wt" |
| 16 | |