diff options
Diffstat (limited to 'server/lib/plugins/plugin-index.ts')
-rw-r--r-- | server/lib/plugins/plugin-index.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/lib/plugins/plugin-index.ts b/server/lib/plugins/plugin-index.ts index 624f5da1d..165bc91b3 100644 --- a/server/lib/plugins/plugin-index.ts +++ b/server/lib/plugins/plugin-index.ts | |||
@@ -67,7 +67,19 @@ async function getLatestPluginsVersion (npmNames: string[]): Promise<PeertubePlu | |||
67 | return body | 67 | return body |
68 | } | 68 | } |
69 | 69 | ||
70 | async function getLatestPluginVersion (npmName: string) { | ||
71 | const results = await getLatestPluginsVersion([ npmName ]) | ||
72 | |||
73 | if (Array.isArray(results) === false || results.length !== 1) { | ||
74 | logger.warn('Cannot get latest supported plugin version of %s.', npmName) | ||
75 | return undefined | ||
76 | } | ||
77 | |||
78 | return results[0].latestVersion | ||
79 | } | ||
80 | |||
70 | export { | 81 | export { |
71 | listAvailablePluginsFromIndex, | 82 | listAvailablePluginsFromIndex, |
83 | getLatestPluginVersion, | ||
72 | getLatestPluginsVersion | 84 | getLatestPluginsVersion |
73 | } | 85 | } |