MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getInstalledPluginVersion

Function getInstalledPluginVersion

src/lib/installPlugin.js:426–433  ·  view source on GitHub ↗

* * @param {string} id * @returns {Promise } plugin version

(id)

Source from the content-addressed store, hash-verified

424 * @returns {Promise<string>} plugin version
425 */
426 async function getInstalledPluginVersion(id) {
427 if (await fsOperation(PLUGIN_DIR, id).exists()) {
428 const plugin = await fsOperation(PLUGIN_DIR, id, "plugin.json").readFile(
429 "json",
430 );
431 return plugin.version;
432 }
433 }
434
435 return resolved;
436}

Callers 1

resolveDepsManifestFunction · 0.85

Calls 3

fsOperationFunction · 0.85
existsMethod · 0.65
readFileMethod · 0.45

Tested by

no test coverage detected