make XDG_CONFIG_HOME
if it doesn't exist
Some checks failed
Playwright Tests / test (push) Has been cancelled
Some checks failed
Playwright Tests / test (push) Has been cancelled
This commit is contained in:
parent
b89debe49c
commit
e85494c575
@ -3,7 +3,7 @@ import { _electron as electron } from "playwright";
|
|||||||
import { Fixtures } from "@playwright/test";
|
import { Fixtures } from "@playwright/test";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { ObsidianTestFixtures } from "./fixtures.js";
|
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 { getApp, waitForIndexingComplete } from "./util.js";
|
||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import { randomBytes } from "crypto";
|
import { randomBytes } from "crypto";
|
||||||
@ -53,6 +53,9 @@ function generateVaultConfig(vault: string) {
|
|||||||
if (process.platform == "win32") {
|
if (process.platform == "win32") {
|
||||||
configLocation = path.join(`${process.env.LOCALAPPDATA}`, "Obsidian");
|
configLocation = path.join(`${process.env.LOCALAPPDATA}`, "Obsidian");
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
|
mkdirSync(process.env.XDG_CONFIG_HOME as string)
|
||||||
|
} catch(e) {}
|
||||||
configLocation = path.join(`${process.env.XDG_CONFIG_HOME}`, "obsidian");
|
configLocation = path.join(`${process.env.XDG_CONFIG_HOME}`, "obsidian");
|
||||||
}
|
}
|
||||||
const obsidianConfigFile = path.join(configLocation, "obsidian.json");
|
const obsidianConfigFile = path.join(configLocation, "obsidian.json");
|
||||||
|
Loading…
Reference in New Issue
Block a user