obsidian-testing-framework 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal-util.js +6 -5
- package/package.json +1 -1
package/lib/internal-util.js
CHANGED
|
@@ -85,10 +85,7 @@ export async function generateVaultConfig(vault, vaultHash, concurrent, vaultPoo
|
|
|
85
85
|
ts: Date.now(),
|
|
86
86
|
};
|
|
87
87
|
await writeFile(obsidianConfigFile, JSON.stringify(json, null, "\t"));
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
return Object.entries(json.vaults).find((a) => a[1].path === vault)[0];
|
|
88
|
+
await writeFile(path.join(configLocation, `${vaultHash}.json`), "{}");
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
catch (err) {
|
|
@@ -97,6 +94,10 @@ export async function generateVaultConfig(vault, vaultHash, concurrent, vaultPoo
|
|
|
97
94
|
finally {
|
|
98
95
|
await releaser();
|
|
99
96
|
}
|
|
100
|
-
await
|
|
97
|
+
const json = JSON.parse((await readFile(obsidianConfigFile)).toString());
|
|
98
|
+
const hasVault = Object.values(json.vaults).some((a) => a.path === vault);
|
|
99
|
+
if (hasVault) {
|
|
100
|
+
return Object.entries(json.vaults).find((a) => a[1].path === vault)[0];
|
|
101
|
+
}
|
|
101
102
|
return vaultHash;
|
|
102
103
|
}
|