This commit is contained in:
parent
ae0500e01e
commit
21b2584ef0
@ -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<ObsidianTestFixtures> = {
|
||||
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[],
|
||||
|
Loading…
Reference in New Issue
Block a user