feat: check for updates

This commit is contained in:
Nicolas Giard
2019-01-13 15:37:45 -05:00
parent 959f2ebde1
commit 63c044a09b
13 changed files with 95 additions and 15 deletions

View File

@@ -5,6 +5,25 @@ const Promise = require('bluebird')
/* global WIKI */
module.exports = {
updates: {
channel: 'BETA',
version: WIKI.version,
releaseDate: WIKI.releaseDate,
minimumVersionRequired: '2.0.0-beta.0',
minimumNodeRequired: '10.12.0'
},
init() {
// Listen for updates events
WIKI.events.on('updates', (infoRaw) => {
try {
this.updates = JSON.parse(infoRaw)
} catch (err) {
WIKI.logger.warn('Failed to parse updates info.')
}
})
return this
},
/**
* Upgrade from WIKI.js 1.x - MongoDB database
*