1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

WIP plugins: plugin settings on server side

This commit is contained in:
Chocobozzz 2019-07-10 16:59:53 +02:00 committed by Chocobozzz
parent ffb321bedc
commit ad91e7006e
20 changed files with 419 additions and 61 deletions

View file

@ -5,12 +5,14 @@ import { CONFIG } from '../../initializers/config'
import { outputJSON, pathExists } from 'fs-extra'
import { join } from 'path'
async function installNpmPlugin (name: string, version: string) {
async function installNpmPlugin (name: string, version?: string) {
// Security check
checkNpmPluginNameOrThrow(name)
checkPluginVersionOrThrow(version)
if (version) checkPluginVersionOrThrow(version)
let toInstall = name
if (version) toInstall += `@${version}`
const toInstall = `${name}@${version}`
await execYarn('add ' + toInstall)
}