From 21b2584ef037550c8971a5ba7ed9ee18357db353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Wed, 23 Oct 2024 18:27:33 -0400 Subject: [PATCH] sighs --- packages/obsidian-testing-framework/src/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/obsidian-testing-framework/src/index.ts b/packages/obsidian-testing-framework/src/index.ts index 3fe8a38..b1b7a8a 100644 --- a/packages/obsidian-testing-framework/src/index.ts +++ b/packages/obsidian-testing-framework/src/index.ts @@ -55,10 +55,13 @@ function generateVaultConfig(vault: string) { } else { configLocation = path.join(`${process.env.XDG_CONFIG_HOME}`, "obsidian"); try { - mkdirSync(configLocation, {recursive: true}) - } catch(e) {} + mkdirSync(configLocation, { recursive: true }); + } catch (e) {} } const obsidianConfigFile = path.join(configLocation, "obsidian.json"); + if (!existsSync(obsidianConfigFile)) { + writeFileSync(obsidianConfigFile, JSON.stringify({ vaults: {} })); + } const json: { vaults: { [key: string]: { @@ -90,12 +93,11 @@ const obsidianTestFixtures: Fixtures = { let uriArg = ""; if (vault) { let id = generateVaultConfig(vault); - if(!!id) { - uriArg = `obsidian://open?vault=${encodeURIComponent(id)}` + if (!!id) { + uriArg = `obsidian://open?vault=${encodeURIComponent(id)}`; } } - const electronApp = await electron.launch({ timeout: 60000, args: [getExe(), uriArg].filter((a) => !!a) as string[],