X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Flib%2Fplugins%2Fyarn.ts;h=9cf6ec9e90e53be6f281c312130f1ab7654109bb;hb=0c302acb3c358b4d4d8dee45aed1de1108ea37ea;hp=3f45681d3f90ca839d575616681a4680b164ca23;hpb=8280d0c22797c72978f698dc2deaa8ef569a9d15;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/plugins/yarn.ts b/server/lib/plugins/yarn.ts index 3f45681d3..9cf6ec9e9 100644 --- a/server/lib/plugins/yarn.ts +++ b/server/lib/plugins/yarn.ts @@ -1,7 +1,7 @@ import { outputJSON, pathExists } from 'fs-extra' import { join } from 'path' import { execShell } from '../../helpers/core-utils' -import { isNpmPluginNameValid, isPluginVersionValid } from '../../helpers/custom-validators/plugins' +import { isNpmPluginNameValid, isPluginStableOrUnstableVersionValid } from '../../helpers/custom-validators/plugins' import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers/config' import { getLatestPluginVersion } from './plugin-index' @@ -31,11 +31,16 @@ async function removeNpmPlugin (name: string) { await execYarn('remove ' + name) } +async function rebuildNativePlugins () { + await execYarn('install --pure-lockfile') +} + // ############################################################################ export { installNpmPlugin, installNpmPluginFromDisk, + rebuildNativePlugins, removeNpmPlugin } @@ -64,5 +69,5 @@ function checkNpmPluginNameOrThrow (name: string) { } function checkPluginVersionOrThrow (name: string) { - if (!isPluginVersionValid(name)) throw new Error('Invalid NPM plugin version to install') + if (!isPluginStableOrUnstableVersionValid(name)) throw new Error('Invalid NPM plugin version to install') }