mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Feat/local install (#6232)
* Added local install * Fixed installing plugin. * Added output for other use case. * Fixed installation.
This commit is contained in:
parent
e63d9aef1b
commit
324ac44ad3
2 changed files with 18 additions and 2 deletions
|
@ -10,7 +10,17 @@ if (process.argv.length === 2) {
|
||||||
process.exit(1);
|
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 persistInstalledPlugins = async () => {
|
||||||
const plugins:PackageData[] = []
|
const plugins:PackageData[] = []
|
||||||
|
@ -27,6 +37,12 @@ const persistInstalledPlugins = async () => {
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
for (const plugin of plugins) {
|
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);
|
await linkInstaller.installPlugin(plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,10 @@ export class LinkInstaller {
|
||||||
|
|
||||||
public async installFromPath(path: string) {
|
public async installFromPath(path: string) {
|
||||||
const installedPlugin = await this.livePluginManager.installFromPath(path)
|
const installedPlugin = await this.livePluginManager.installFromPath(path)
|
||||||
|
this.linkDependency(installedPlugin.name)
|
||||||
await this.checkLinkedDependencies(installedPlugin)
|
await this.checkLinkedDependencies(installedPlugin)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async installPlugin(pluginName: string, version?: string) {
|
public async installPlugin(pluginName: string, version?: string) {
|
||||||
if (version) {
|
if (version) {
|
||||||
const installedPlugin = await this.livePluginManager.install(pluginName, version);
|
const installedPlugin = await this.livePluginManager.install(pluginName, version);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue