mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-27 03:41:11 +01:00
Separate app DB per Git worktree (#348)
This commit is contained in:
@@ -86,6 +86,9 @@ try {
|
||||
// Continue with default ports
|
||||
}
|
||||
|
||||
// Get worktree name from current directory
|
||||
const worktreeName = path.basename(process.cwd());
|
||||
|
||||
// Create .env.local with unique ports
|
||||
const envContent = `# Auto-generated by git post-checkout hook
|
||||
# This file configures ports for this worktree to avoid conflicts
|
||||
@@ -95,6 +98,9 @@ YAAK_DEV_PORT=${maxDevPort}
|
||||
|
||||
# MCP Server port (main worktree uses 64343)
|
||||
YAAK_PLUGIN_MCP_SERVER_PORT=${maxMcpPort}
|
||||
|
||||
# Database path prefix for worktree isolation
|
||||
YAAK_DB_PATH_PREFIX=worktrees/${worktreeName}
|
||||
`;
|
||||
|
||||
fs.writeFileSync(envLocalPath, envContent, 'utf8');
|
||||
|
||||
Reference in New Issue
Block a user