diff --git a/src/cloudron.js b/src/cloudron.js index 34a62b30c..f4b0b9156 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -514,7 +514,12 @@ function update(boxUpdateInfo, callback) { progress.set(progress.UPDATE, 0, 'Starting'); // initiate the update/upgrade but do not wait for it - if (boxUpdateInfo.upgrade) { + if (config.version().match(/[-+]/) !== null && (config.version() === boxUpdateInfo.version.replace(/[-+].*/, ''))) { + debug('Starting short-circuit from prerelease version %s to release version %s', config.version(), boxUpdateInfo.version); + config.setVersion(boxUpdateInfo.version); + progress.set(progress.UPDATE, 100, ''); + locker.unlock(locker.OP_BOX_UPDATE); + } else if (boxUpdateInfo.upgrade) { debug('Starting upgrade'); doUpgrade(boxUpdateInfo, function (error) { if (error) { diff --git a/src/config.js b/src/config.js index 5f178521f..6b0e008a4 100644 --- a/src/config.js +++ b/src/config.js @@ -23,6 +23,7 @@ exports = module.exports = { fqdn: fqdn, token: token, version: version, + setVersion: setVersion, isCustomDomain: isCustomDomain, database: database, @@ -179,6 +180,10 @@ function version() { return get('version'); } +function setVersion(version) { + set('version', version); +} + function isCustomDomain() { return get('isCustomDomain'); }