mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
lint: Convert CR+LF line endings to LF
This commit is contained in:
parent
a78d6605b7
commit
cc988bd67b
6 changed files with 243 additions and 243 deletions
|
@ -1,44 +1,44 @@
|
|||
const semver = require('semver');
|
||||
const settings = require('./Settings');
|
||||
const request = require('request');
|
||||
|
||||
let infos;
|
||||
|
||||
function loadEtherpadInformations() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
request('https://static.etherpad.org/info.json', function (er, response, body) {
|
||||
if (er) return reject(er);
|
||||
|
||||
try {
|
||||
infos = JSON.parse(body);
|
||||
return resolve(infos);
|
||||
} catch (err) {
|
||||
return reject(err);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
exports.getLatestVersion = function() {
|
||||
exports.needsUpdate();
|
||||
return infos.latestVersion;
|
||||
}
|
||||
|
||||
exports.needsUpdate = function(cb) {
|
||||
loadEtherpadInformations().then(function(info) {
|
||||
if (semver.gt(info.latestVersion, settings.getEpVersion())) {
|
||||
if (cb) return cb(true);
|
||||
}
|
||||
}).catch(function (err) {
|
||||
console.error('Can not perform Etherpad update check: ' + err)
|
||||
if (cb) return cb(false);
|
||||
})
|
||||
}
|
||||
|
||||
exports.check = function() {
|
||||
exports.needsUpdate(function (needsUpdate) {
|
||||
if (needsUpdate) {
|
||||
console.warn('Update available: Download the actual version ' + infos.latestVersion)
|
||||
}
|
||||
})
|
||||
}
|
||||
const semver = require('semver');
|
||||
const settings = require('./Settings');
|
||||
const request = require('request');
|
||||
|
||||
let infos;
|
||||
|
||||
function loadEtherpadInformations() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
request('https://static.etherpad.org/info.json', function (er, response, body) {
|
||||
if (er) return reject(er);
|
||||
|
||||
try {
|
||||
infos = JSON.parse(body);
|
||||
return resolve(infos);
|
||||
} catch (err) {
|
||||
return reject(err);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
exports.getLatestVersion = function() {
|
||||
exports.needsUpdate();
|
||||
return infos.latestVersion;
|
||||
}
|
||||
|
||||
exports.needsUpdate = function(cb) {
|
||||
loadEtherpadInformations().then(function(info) {
|
||||
if (semver.gt(info.latestVersion, settings.getEpVersion())) {
|
||||
if (cb) return cb(true);
|
||||
}
|
||||
}).catch(function (err) {
|
||||
console.error('Can not perform Etherpad update check: ' + err)
|
||||
if (cb) return cb(false);
|
||||
})
|
||||
}
|
||||
|
||||
exports.check = function() {
|
||||
exports.needsUpdate(function (needsUpdate) {
|
||||
if (needsUpdate) {
|
||||
console.warn('Update available: Download the actual version ' + infos.latestVersion)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue