1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Add CLI plugins tests

This commit is contained in:
Chocobozzz 2019-07-19 10:37:35 +02:00 committed by Chocobozzz
parent 32fe001389
commit 9b474844e8
22 changed files with 611 additions and 170 deletions

View file

@ -5,12 +5,12 @@ 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 (npmName: string, version?: string) {
// Security check
checkNpmPluginNameOrThrow(name)
checkNpmPluginNameOrThrow(npmName)
if (version) checkPluginVersionOrThrow(version)
let toInstall = name
let toInstall = npmName
if (version) toInstall += `@${version}`
await execYarn('add ' + toInstall)