import { chunk } from 'lodash'
import { getLatestPluginsVersion } from '../plugins/plugin-index'
import { compareSemVer } from '../../../shared/core-utils/miscs/miscs'
+import { Notifier } from '../notifier'
export class PluginsCheckScheduler extends AbstractScheduler {
const results = await getLatestPluginsVersion(npmNames)
for (const result of results) {
- const plugin = pluginIndex[ result.npmName ]
+ const plugin = pluginIndex[result.npmName]
if (!result.latestVersion) continue
if (
plugin.latestVersion = result.latestVersion
await plugin.save()
+ // Notify if there is an higher plugin version available
+ if (compareSemVer(plugin.version, result.latestVersion) < 0) {
+ Notifier.Instance.notifyOfNewPluginVersion(plugin)
+ }
+
logger.info('Plugin %s has a new latest version %s.', result.npmName, plugin.latestVersion)
}
}