make XDG_CONFIG_HOME if it doesn't exist
Some checks failed
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
parent b89debe49c
commit e85494c575
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -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");