diff --git a/packages/obsidian-testing-framework/src/index.ts b/packages/obsidian-testing-framework/src/index.ts index 08a2da5..2fc1028 100644 --- a/packages/obsidian-testing-framework/src/index.ts +++ b/packages/obsidian-testing-framework/src/index.ts @@ -3,7 +3,7 @@ import { _electron as electron } from "playwright"; import { Fixtures } from "@playwright/test"; import path from "path"; import { ObsidianTestFixtures } from "./fixtures.js"; -import { existsSync, readFileSync, writeFileSync } from "fs"; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs"; import { getApp, waitForIndexingComplete } from "./util.js"; import { execSync } from "child_process"; import { randomBytes } from "crypto"; @@ -53,6 +53,9 @@ function generateVaultConfig(vault: string) { if (process.platform == "win32") { configLocation = path.join(`${process.env.LOCALAPPDATA}`, "Obsidian"); } else { + try { + mkdirSync(process.env.XDG_CONFIG_HOME as string) + } catch(e) {} configLocation = path.join(`${process.env.XDG_CONFIG_HOME}`, "obsidian"); } const obsidianConfigFile = path.join(configLocation, "obsidian.json");