Skip to content

Commit 7c38e51

Browse files
authored
fix(desktop): respect opencode jsonc on electron startup (anomalyco#1666)
Co-authored-by: src-opn <[email protected]>
1 parent 5625dd4 commit 7c38e51

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/desktop/electron/runtime.mjs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -936,11 +936,12 @@ export function createRuntimeManager({ app, desktopRoot, listLocalWorkspacePaths
936936
}
937937

938938
async function ensureOpencodeConfig(projectDir) {
939-
const configPath = path.join(projectDir, "opencode.json");
940-
if (await fileExists(configPath)) return;
939+
const jsoncPath = path.join(projectDir, "opencode.jsonc");
940+
const jsonPath = path.join(projectDir, "opencode.json");
941+
if ((await fileExists(jsoncPath)) || (await fileExists(jsonPath))) return;
941942
await mkdir(projectDir, { recursive: true });
942943
await writeFile(
943-
configPath,
944+
jsoncPath,
944945
`${JSON.stringify({ $schema: "https://opencode.ai/config.json" }, null, 2)}\n`,
945946
"utf8",
946947
);

0 commit comments

Comments
 (0)