diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-10 16:59:53 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | ad91e7006e41f8ee5b8dcefee30f99e8ca44133a (patch) | |
tree | d860f20e05b036fa1a96e049c74deffd7f5d2b00 /server/lib/plugins/yarn.ts | |
parent | ffb321bedca46d6987c7b31dd58e5dea96ea2ea2 (diff) | |
download | PeerTube-ad91e7006e41f8ee5b8dcefee30f99e8ca44133a.tar.gz PeerTube-ad91e7006e41f8ee5b8dcefee30f99e8ca44133a.tar.zst PeerTube-ad91e7006e41f8ee5b8dcefee30f99e8ca44133a.zip |
WIP plugins: plugin settings on server side
Diffstat (limited to 'server/lib/plugins/yarn.ts')
-rw-r--r-- | server/lib/plugins/yarn.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/plugins/yarn.ts b/server/lib/plugins/yarn.ts index 35fe1625f..5fe1c5046 100644 --- a/server/lib/plugins/yarn.ts +++ b/server/lib/plugins/yarn.ts | |||
@@ -5,12 +5,14 @@ import { CONFIG } from '../../initializers/config' | |||
5 | import { outputJSON, pathExists } from 'fs-extra' | 5 | import { outputJSON, pathExists } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | 7 | ||
8 | async function installNpmPlugin (name: string, version: string) { | 8 | async function installNpmPlugin (name: string, version?: string) { |
9 | // Security check | 9 | // Security check |
10 | checkNpmPluginNameOrThrow(name) | 10 | checkNpmPluginNameOrThrow(name) |
11 | checkPluginVersionOrThrow(version) | 11 | if (version) checkPluginVersionOrThrow(version) |
12 | |||
13 | let toInstall = name | ||
14 | if (version) toInstall += `@${version}` | ||
12 | 15 | ||
13 | const toInstall = `${name}@${version}` | ||
14 | await execYarn('add ' + toInstall) | 16 | await execYarn('add ' + toInstall) |
15 | } | 17 | } |
16 | 18 | ||