diff options
| author | Dax Raad <[email protected]> | 2026-01-04 10:10:11 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-01-04 10:10:25 -0500 |
| commit | 2d074f0472dc84c834c4d6486d07530880ba973e (patch) | |
| tree | df56afde0f6ae51f11c183af7f3bc4ff680288ad | |
| parent | f3cd3b894169c8dd366804a90ce31ce721011746 (diff) | |
| download | opencode-2d074f0472dc84c834c4d6486d07530880ba973e.tar.gz opencode-2d074f0472dc84c834c4d6486d07530880ba973e.zip | |
initialize config in worktree
| -rw-r--r-- | packages/opencode/src/config/config.ts | 4 | ||||
| -rw-r--r-- | packages/opencode/src/worktree/index.ts | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index fb9d293a1..b6688f8c9 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -161,9 +161,7 @@ export namespace Config { } }) - async function installDependencies(dir: string) { - // if (Installation.isLocal()) return - + export async function installDependencies(dir: string) { const pkg = path.join(dir, "package.json") if (!(await Bun.file(pkg).exists())) { diff --git a/packages/opencode/src/worktree/index.ts b/packages/opencode/src/worktree/index.ts index ba3017f4c..4227d76b9 100644 --- a/packages/opencode/src/worktree/index.ts +++ b/packages/opencode/src/worktree/index.ts @@ -7,6 +7,7 @@ import { Global } from "../global" import { Instance } from "../project/instance" import { Project } from "../project/project" import { fn } from "../util/fn" +import { Config } from "@/config/config" export namespace Worktree { export const Info = z @@ -211,6 +212,11 @@ export namespace Worktree { throw new StartCommandFailedError({ message: errorText(ran) || "Worktree start command failed" }) } + const opencodeDir = path.join(info.directory, ".opencode") + if (await Bun.file(opencodeDir).exists()) { + await Config.installDependencies(info.directory) + } + return info }) } |
