diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-17 10:03:55 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 66170ca8c64fa4e76f3830e4a02a11345a03093b (patch) | |
tree | d2ef070a8e3cc98badcf6492f4d7db345c157d91 /server/lib/plugins/plugin-index.ts | |
parent | 109d893ff5353c3061af3062cf9443bcba39aafc (diff) | |
download | PeerTube-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.ts | 7 |
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 | |||
10 | import { PluginModel } from '../../models/server/plugin' | 10 | import { PluginModel } from '../../models/server/plugin' |
11 | import { PluginManager } from './plugin-manager' | 11 | import { PluginManager } from './plugin-manager' |
12 | import { logger } from '../../helpers/logger' | 12 | import { logger } from '../../helpers/logger' |
13 | 13 | import { PEERTUBE_VERSION } from '../../initializers/constants' | |
14 | const packageJSON = require('../../../../package.json') | ||
15 | 14 | ||
16 | async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList) { | 15 | async 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>) | |||
53 | async function getLatestPluginsVersion (npmNames: string[]): Promise<PeertubePluginLatestVersionResponse> { | 52 | async 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' |