From 66170ca8c64fa4e76f3830e4a02a11345a03093b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Jul 2019 10:03:55 +0200 Subject: Use process.env.npm_package_version --- server/lib/plugins/plugin-index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'server/lib/plugins') diff --git a/server/lib/plugins/plugin-index.ts b/server/lib/plugins/plugin-index.ts index 63cd47e63..6b7810618 100644 --- a/server/lib/plugins/plugin-index.ts +++ b/server/lib/plugins/plugin-index.ts @@ -10,8 +10,7 @@ import { PeerTubePluginIndex } from '../../../shared/models/plugins/peertube-plu import { PluginModel } from '../../models/server/plugin' import { PluginManager } from './plugin-manager' import { logger } from '../../helpers/logger' - -const packageJSON = require('../../../../package.json') +import { PEERTUBE_VERSION } from '../../initializers/constants' async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList) { const { start = 0, count = 20, search, sort = 'npmName', pluginType } = options @@ -22,7 +21,7 @@ async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList) sort, pluginType, search, - currentPeerTubeEngine: packageJSON.version + currentPeerTubeEngine: PEERTUBE_VERSION } const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins' @@ -53,7 +52,7 @@ async function addInstanceInformation (result: ResultList) async function getLatestPluginsVersion (npmNames: string[]): Promise { const bodyRequest: PeertubePluginLatestVersionRequest = { npmNames, - currentPeerTubeEngine: packageJSON.version + currentPeerTubeEngine: PEERTUBE_VERSION } const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins/latest-version' -- cgit v1.2.3