Feat/local install (#6232)

* Added local install

* Fixed installing plugin.

* Added output for other use case.

* Fixed installation.
This commit is contained in:
SamTV12345 2024-03-16 14:50:34 +01:00 committed by GitHub
parent e63d9aef1b
commit 324ac44ad3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 2 deletions

View file

@ -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);
}
}