Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/opencode/src/project/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ async function setupProjectIdEnvironment(workingDir: string): Promise<void> {

// Belt-and-suspenders: ensure .git/info/exclude lists .mimocode-project-id
const excludeFile = nodePath.join(mainGit, "info", "exclude")
await nodeFs.mkdir(nodePath.dirname(excludeFile), { recursive: true })
await nodeFs
.mkdir(nodePath.dirname(excludeFile), { recursive: true })
.catch((e: any) => {
// Windows: EEXIST is thrown when the directory has the ReadOnly
// attribute (e.g. OneDrive-synced folders). nodejs#43994.
if (e?.code !== "EEXIST") throw e
})
const existing = await nodeFs.readFile(excludeFile, "utf-8").catch(() => "")
if (!existing.includes(".mimocode-project-id")) {
await nodeFs.appendFile(excludeFile, "\n.mimocode-project-id\n")
Expand Down