From 324ac44ad3929e4bb56c55f828e90ec5143c3ab7 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+SamTV12345@users.noreply.github.com> Date: Sat, 16 Mar 2024 14:50:34 +0100 Subject: [PATCH] Feat/local install (#6232) * Added local install * Fixed installing plugin. * Added output for other use case. * Fixed installation. --- bin/installPlugins.ts | 18 +++++++++++++++++- src/static/js/pluginfw/LinkInstaller.ts | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bin/installPlugins.ts b/bin/installPlugins.ts index bc7c3fdf8..8a6a71345 100644 --- a/bin/installPlugins.ts +++ b/bin/installPlugins.ts @@ -10,7 +10,17 @@ if (process.argv.length === 2) { process.exit(1); } -const plugins = process.argv.slice(2); +let plugins = process.argv.slice(2) +let installFromPath = false; + +const thirdOptPlug = plugins[0] + +console.log("Third option: ", thirdOptPlug) +if (thirdOptPlug && thirdOptPlug.includes('path')) { + installFromPath = true + plugins.splice(plugins.indexOf('--path'), 1); +} + const persistInstalledPlugins = async () => { const plugins:PackageData[] = [] @@ -27,6 +37,12 @@ const persistInstalledPlugins = async () => { async function run() { for (const plugin of plugins) { + if(installFromPath) { + console.log(`Installing plugin from path: ${plugin}`); + await linkInstaller.installFromPath(plugin); + continue; + } + console.log(`Installing plugin from registry: ${plugin}`) await linkInstaller.installPlugin(plugin); } } diff --git a/src/static/js/pluginfw/LinkInstaller.ts b/src/static/js/pluginfw/LinkInstaller.ts index fbb5cd391..a3034e281 100644 --- a/src/static/js/pluginfw/LinkInstaller.ts +++ b/src/static/js/pluginfw/LinkInstaller.ts @@ -40,10 +40,10 @@ export class LinkInstaller { public async installFromPath(path: string) { const installedPlugin = await this.livePluginManager.installFromPath(path) + this.linkDependency(installedPlugin.name) await this.checkLinkedDependencies(installedPlugin) } - public async installPlugin(pluginName: string, version?: string) { if (version) { const installedPlugin = await this.livePluginManager.install(pluginName, version);