diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-12 10:10:48 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-12 10:10:48 +0200 |
commit | 8280d0c22797c72978f698dc2deaa8ef569a9d15 (patch) | |
tree | 8136abd28c9aa0c5050bb66e2f6f7451117b57f2 /server/lib/plugins/plugin-index.ts | |
parent | 90aa0a74e95d390d62942aa72d481d5aa7b5ac23 (diff) | |
download | PeerTube-8280d0c22797c72978f698dc2deaa8ef569a9d15.tar.gz PeerTube-8280d0c22797c72978f698dc2deaa8ef569a9d15.tar.zst PeerTube-8280d0c22797c72978f698dc2deaa8ef569a9d15.zip |
Ensure to install supported plugins
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 | } |