diff options
author | John Livingston <38844060+JohnXLivingston@users.noreply.github.com> | 2021-12-03 10:14:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-03 10:14:01 +0100 |
commit | 3a1157a68a70e90df21f743ea15154805649b8e5 (patch) | |
tree | 16cf8151e6717f9025f53aec28c3a85c003377fb /shared/extra-utils/server/plugins-command.ts | |
parent | 37cb07eae26b1b73b118e256df71243ae298fa72 (diff) | |
download | PeerTube-3a1157a68a70e90df21f743ea15154805649b8e5.tar.gz PeerTube-3a1157a68a70e90df21f743ea15154805649b8e5.tar.zst PeerTube-3a1157a68a70e90df21f743ea15154805649b8e5.zip |
CLI: plugins install command accept a --plugin-version parameter. (#4599)
* CLI: plugins install command accept a --plugin-version parameter.
* Unit tests for plugins install --plugin-version.
* Fix linting.
* Styling
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'shared/extra-utils/server/plugins-command.ts')
-rw-r--r-- | shared/extra-utils/server/plugins-command.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shared/extra-utils/server/plugins-command.ts b/shared/extra-utils/server/plugins-command.ts index b944475a2..9bf24afff 100644 --- a/shared/extra-utils/server/plugins-command.ts +++ b/shared/extra-utils/server/plugins-command.ts | |||
@@ -158,15 +158,16 @@ export class PluginsCommand extends AbstractCommand { | |||
158 | install (options: OverrideCommandOptions & { | 158 | install (options: OverrideCommandOptions & { |
159 | path?: string | 159 | path?: string |
160 | npmName?: string | 160 | npmName?: string |
161 | pluginVersion?: string | ||
161 | }) { | 162 | }) { |
162 | const { npmName, path } = options | 163 | const { npmName, path, pluginVersion } = options |
163 | const apiPath = '/api/v1/plugins/install' | 164 | const apiPath = '/api/v1/plugins/install' |
164 | 165 | ||
165 | return this.postBodyRequest({ | 166 | return this.postBodyRequest({ |
166 | ...options, | 167 | ...options, |
167 | 168 | ||
168 | path: apiPath, | 169 | path: apiPath, |
169 | fields: { npmName, path }, | 170 | fields: { npmName, path, pluginVersion }, |
170 | implicitToken: true, | 171 | implicitToken: true, |
171 | defaultExpectedStatus: HttpStatusCode.OK_200 | 172 | defaultExpectedStatus: HttpStatusCode.OK_200 |
172 | }) | 173 | }) |