initialize config in worktree
This commit is contained in:
parent
f3cd3b8941
commit
2d074f0472
2 changed files with 7 additions and 3 deletions
|
|
@ -161,9 +161,7 @@ export namespace Config {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
async function installDependencies(dir: string) {
|
export async function installDependencies(dir: string) {
|
||||||
// if (Installation.isLocal()) return
|
|
||||||
|
|
||||||
const pkg = path.join(dir, "package.json")
|
const pkg = path.join(dir, "package.json")
|
||||||
|
|
||||||
if (!(await Bun.file(pkg).exists())) {
|
if (!(await Bun.file(pkg).exists())) {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { Global } from "../global"
|
||||||
import { Instance } from "../project/instance"
|
import { Instance } from "../project/instance"
|
||||||
import { Project } from "../project/project"
|
import { Project } from "../project/project"
|
||||||
import { fn } from "../util/fn"
|
import { fn } from "../util/fn"
|
||||||
|
import { Config } from "@/config/config"
|
||||||
|
|
||||||
export namespace Worktree {
|
export namespace Worktree {
|
||||||
export const Info = z
|
export const Info = z
|
||||||
|
|
@ -211,6 +212,11 @@ export namespace Worktree {
|
||||||
throw new StartCommandFailedError({ message: errorText(ran) || "Worktree start command failed" })
|
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
|
return info
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue