fix: ensure opencode still works if no commits present

This commit is contained in:
Aiden Cline 2025-09-01 17:18:34 -05:00
parent 7b62c10553
commit 880ed9abc9

View file

@ -53,6 +53,17 @@ export namespace Project {
.map((x) => x.trim())
.toSorted(),
)
if (!id) {
const project: Info = {
id: "global",
worktree: "/",
time: {
created: Date.now(),
},
}
await Storage.write<Info>(["project", "global"], project)
return project
}
worktree = path.dirname(
await $`git rev-parse --path-format=absolute --git-common-dir`
.quiet()