ops(OPS55): worktree respeita WORKTREES_ROOT do .forgejo/worktree.env

- worktree.mjs: WORKTREES_ROOT = env ?? fallback (~/.cursor/worktrees/teqo)
- .forgejo/worktree.env novo: FORGEJO_REPOSITORY=fsolla/teqo + root atual
  (migração para ~/.worktrees/teqo fica para quando as sessões opencode
  ativas nos worktrees antigos fecharem — OPS52/OPS53/PUB5)

Roteador global (~/.config/shell/worktree.sh) exporta as chaves do arquivo
por projeto; iara-pwa já usa o mesmo mecanismo.
This commit is contained in:
Francisco Solla 2026-08-17 22:34:21 -03:00 committed by fsolla
parent 0aec0d5040
commit ff14cef653
2 changed files with 7 additions and 1 deletions

5
.forgejo/worktree.env Normal file
View file

@ -0,0 +1,5 @@
FORGEJO_REPOSITORY=fsolla/teqo
# Mantém o root atual enquanto houver sessões opencode ativas nos worktrees
# antigos (OPS52/OPS53/PUB5 em ~/.cursor/worktrees/teqo). Quando todas
# fecharem, migrar para ~/.worktrees/teqo (git worktree move) e trocar aqui.
WORKTREES_ROOT=~/.cursor/worktrees/teqo

View file

@ -141,7 +141,8 @@ import {
} from './lib/worktree.mjs'
const die = dieAgent('worktree')
const WORKTREES_ROOT = join(homedir(), '.cursor', 'worktrees', 'teqo')
const WORKTREES_ROOT =
process.env.WORKTREES_ROOT ?? join(homedir(), '.cursor', 'worktrees', 'teqo')
/**
* True when the interactive terminal shell function (`.agents/shell/worktree.sh`)