fix(v2): update notifier should never suggest to downgrade (#4784)

see https://github.com/yeoman/update-notifier/pull/192
This commit is contained in:
Sébastien Lorber 2021-05-13 14:31:37 +02:00 committed by GitHub
parent 3c6a0ac97e
commit dd8d650900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,7 @@ if (notifier.lastUpdateCheck === Date.now()) {
notifier.lastUpdateCheck = 0;
}
if (notifier.update && notifier.update.current !== notifier.update.latest) {
if (notifier.update && semver.gt(this.update.latest, this.update.current)) {
// eslint-disable-next-line import/no-dynamic-require, global-require
const sitePkg = require(path.resolve(process.cwd(), 'package.json'));
const siteDocusaurusPackagesForUpdate = Object.keys(sitePkg.dependencies)