- if (plugin.latestVersion !== result.latestVersion && compareSemVer(plugin.latestVersion, result.latestVersion) < 0) {
- plugin.latestVersion = result.latestVersion
- await plugin.save()
+ for (const result of results) {
+ const plugin = pluginIndex[ result.npmName ]
+ if (!result.latestVersion) continue
+
+ if (
+ !plugin.latestVersion ||
+ (plugin.latestVersion !== result.latestVersion && compareSemVer(plugin.latestVersion, result.latestVersion) < 0)
+ ) {
+ plugin.latestVersion = result.latestVersion
+ await plugin.save()
+
+ logger.info('Plugin %s has a new latest version %s.', result.npmName, plugin.latestVersion)
+ }