chore: setup worktree on folder open

This commit is contained in:
Abhishek Kumar 2026-06-30 16:15:10 +05:30
parent 2249d944f3
commit a616b7ff98
2 changed files with 58 additions and 18 deletions

32
.vscode/tasks.json vendored
View file

@ -1,8 +1,12 @@
{
// Auto-runs when a worktree folder is opened. The first time, VS Code asks
// to "Allow Automatic Tasks in Folder" (or run it via the command palette:
// "Tasks: Allow Automatic Tasks in Folder"). Assigns this worktree a unique
// backend port and points the UI env at it see scripts/worktree-assign-port.sh.
// Tasks that auto-run when a worktree folder is opened (runOptions.runOn:
// folderOpen). First time, VS Code asks to "Allow Automatic Tasks in Folder"
// (or set task.allowAutomaticTasks: "on" in User settings to skip the prompt).
// - "Assign worktree port" : fast; sets UVICORN_PORT + UI BACKEND_URLs
// - "Set up worktree environment" : heavy first time (submodule + venv +
// deps), instant skip after run-once via
// venv/.worktree-setup-complete. Follow it:
// tail -f logs/setup-worktree.log
"version": "2.0.0",
"tasks": [
{
@ -20,9 +24,23 @@
"problemMatcher": []
},
{
// Manual, one-time per worktree (heavy: submodule + venv + deps).
// Run via: Tasks: Run Task -> "Setup worktree environment".
"label": "Setup worktree environment",
"label": "Set up worktree environment",
"type": "shell",
"command": "${workspaceFolder}/scripts/setup-worktree.sh",
"args": ["--if-needed"],
"presentation": {
"reveal": "silent",
"panel": "dedicated"
},
"runOptions": {
"runOn": "folderOpen"
},
"problemMatcher": []
},
{
// Manual: force a full re-provision, ignoring the run-once sentinel.
// Run via: Tasks: Run Task -> "Re-setup worktree (force)".
"label": "Re-setup worktree (force)",
"type": "shell",
"command": "${workspaceFolder}/scripts/setup-worktree.sh",
"presentation": {