X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Fplugins-command.ts;h=1c44711da8a969259e48b80146bd459a32385039;hb=06aad80165d09a8863ab8103149a8ff518b10641;hp=ff49d58c49557568fbdf2ba988fbb31fa6ba0e60;hpb=a1637fa1e25b60a88f7cfe50aac8953f50d55761;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/server/plugins-command.ts b/shared/extra-utils/server/plugins-command.ts index ff49d58c4..1c44711da 100644 --- a/shared/extra-utils/server/plugins-command.ts +++ b/shared/extra-utils/server/plugins-command.ts @@ -2,9 +2,9 @@ import { readJSON, writeJSON } from 'fs-extra' import { join } from 'path' -import { root } from '@server/helpers/core-utils' -import { HttpStatusCode } from '@shared/core-utils' +import { root } from '@shared/core-utils' import { + HttpStatusCode, PeerTubePlugin, PeerTubePluginIndex, PeertubePluginIndexList, @@ -15,7 +15,6 @@ import { RegisteredServerSettings, ResultList } from '@shared/models' -import { buildServerDirectory } from '../miscs' import { AbstractCommand, OverrideCommandOptions } from '../shared' export class PluginsCommand extends AbstractCommand { @@ -159,15 +158,16 @@ export class PluginsCommand extends AbstractCommand { install (options: OverrideCommandOptions & { path?: string npmName?: string + pluginVersion?: string }) { - const { npmName, path } = options + const { npmName, path, pluginVersion } = options const apiPath = '/api/v1/plugins/install' return this.postBodyRequest({ ...options, path: apiPath, - fields: { npmName, path }, + fields: { npmName, path, pluginVersion }, implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) @@ -252,6 +252,6 @@ export class PluginsCommand extends AbstractCommand { } private getPackageJSONPath (npmName: string) { - return buildServerDirectory(this.server, join('plugins', 'node_modules', npmName, 'package.json')) + return this.server.servers.buildDirectory(join('plugins', 'node_modules', npmName, 'package.json')) } }