From e85494c5755116f8cb361244e86bdcfff0619859 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:21:34 -0400 Subject: [PATCH] make `XDG_CONFIG_HOME` if it doesn't exist --- packages/obsidian-testing-framework/src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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");