aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-index.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-17 10:03:55 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit66170ca8c64fa4e76f3830e4a02a11345a03093b (patch)
treed2ef070a8e3cc98badcf6492f4d7db345c157d91 /server/lib/plugins/plugin-index.ts
parent109d893ff5353c3061af3062cf9443bcba39aafc (diff)
downloadPeerTube-66170ca8c64fa4e76f3830e4a02a11345a03093b.tar.gz
PeerTube-66170ca8c64fa4e76f3830e4a02a11345a03093b.tar.zst
PeerTube-66170ca8c64fa4e76f3830e4a02a11345a03093b.zip
Use process.env.npm_package_version
Diffstat (limited to 'server/lib/plugins/plugin-index.ts')
-rw-r--r--server/lib/plugins/plugin-index.ts7
1 files changed, 3 insertions, 4 deletions
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
10import { PluginModel } from '../../models/server/plugin' 10import { PluginModel } from '../../models/server/plugin'
11import { PluginManager } from './plugin-manager' 11import { PluginManager } from './plugin-manager'
12import { logger } from '../../helpers/logger' 12import { logger } from '../../helpers/logger'
13 13import { PEERTUBE_VERSION } from '../../initializers/constants'
14const packageJSON = require('../../../../package.json')
15 14
16async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList) { 15async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList) {
17 const { start = 0, count = 20, search, sort = 'npmName', pluginType } = options 16 const { start = 0, count = 20, search, sort = 'npmName', pluginType } = options
@@ -22,7 +21,7 @@ async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList)
22 sort, 21 sort,
23 pluginType, 22 pluginType,
24 search, 23 search,
25 currentPeerTubeEngine: packageJSON.version 24 currentPeerTubeEngine: PEERTUBE_VERSION
26 } 25 }
27 26
28 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins' 27 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins'
@@ -53,7 +52,7 @@ async function addInstanceInformation (result: ResultList<PeerTubePluginIndex>)
53async function getLatestPluginsVersion (npmNames: string[]): Promise<PeertubePluginLatestVersionResponse> { 52async function getLatestPluginsVersion (npmNames: string[]): Promise<PeertubePluginLatestVersionResponse> {
54 const bodyRequest: PeertubePluginLatestVersionRequest = { 53 const bodyRequest: PeertubePluginLatestVersionRequest = {
55 npmNames, 54 npmNames,
56 currentPeerTubeEngine: packageJSON.version 55 currentPeerTubeEngine: PEERTUBE_VERSION
57 } 56 }
58 57
59 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins/latest-version' 58 const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins/latest-version'