This commit is contained in:
parent
ae0500e01e
commit
21b2584ef0
@ -55,10 +55,13 @@ function generateVaultConfig(vault: string) {
|
|||||||
} else {
|
} else {
|
||||||
configLocation = path.join(`${process.env.XDG_CONFIG_HOME}`, "obsidian");
|
configLocation = path.join(`${process.env.XDG_CONFIG_HOME}`, "obsidian");
|
||||||
try {
|
try {
|
||||||
mkdirSync(configLocation, {recursive: true})
|
mkdirSync(configLocation, { recursive: true });
|
||||||
} catch(e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
const obsidianConfigFile = path.join(configLocation, "obsidian.json");
|
const obsidianConfigFile = path.join(configLocation, "obsidian.json");
|
||||||
|
if (!existsSync(obsidianConfigFile)) {
|
||||||
|
writeFileSync(obsidianConfigFile, JSON.stringify({ vaults: {} }));
|
||||||
|
}
|
||||||
const json: {
|
const json: {
|
||||||
vaults: {
|
vaults: {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
@ -90,12 +93,11 @@ const obsidianTestFixtures: Fixtures<ObsidianTestFixtures> = {
|
|||||||
let uriArg = "";
|
let uriArg = "";
|
||||||
if (vault) {
|
if (vault) {
|
||||||
let id = generateVaultConfig(vault);
|
let id = generateVaultConfig(vault);
|
||||||
if(!!id) {
|
if (!!id) {
|
||||||
uriArg = `obsidian://open?vault=${encodeURIComponent(id)}`
|
uriArg = `obsidian://open?vault=${encodeURIComponent(id)}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const electronApp = await electron.launch({
|
const electronApp = await electron.launch({
|
||||||
timeout: 60000,
|
timeout: 60000,
|
||||||
args: [getExe(), uriArg].filter((a) => !!a) as string[],
|
args: [getExe(), uriArg].filter((a) => !!a) as string[],
|
||||||
|
Loading…
Reference in New Issue
Block a user