obsidian-testing-framework 0.4.3 → 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.
@@ -86,10 +86,6 @@ export async function generateVaultConfig(vault, vaultHash, concurrent, vaultPoo
86
86
  };
87
87
  await writeFile(obsidianConfigFile, JSON.stringify(json, null, "\t"));
88
88
  await writeFile(path.join(configLocation, `${vaultHash}.json`), "{}");
89
- return vaultHash;
90
- }
91
- else {
92
- return Object.entries(json.vaults).find((a) => a[1].path === vault)[0];
93
89
  }
94
90
  }
95
91
  catch (err) {
@@ -98,5 +94,10 @@ export async function generateVaultConfig(vault, vaultHash, concurrent, vaultPoo
98
94
  finally {
99
95
  await releaser();
100
96
  }
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
  }
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  ".": "./lib/index.js"
30
30
  },
31
31
  "readme": "",
32
- "version": "0.4.3",
32
+ "version": "0.4.4",
33
33
  "main": "./lib/index.js",
34
34
  "typings": "./lib/index.d.ts",
35
35
  "repository": {