From f00a3dbf49216afded7bbdfe2a8606a0ef813a80 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 1 Dec 2014 12:03:42 -0500 Subject: [PATCH] minor fix to upgrade script --- src/upgrade.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/upgrade.js b/src/upgrade.js index 1371af5927..9ff03a3e97 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -314,11 +314,25 @@ Upgrade.upgrade = function(callback) { function(config, next) { try { config = JSON.parse(config); + + // If the config contains "url", it has already been updated, abort. + if (config.hasOwnProperty('url')) { + return next(); + } + config.url = config.base_url + (config.use_port ? ':' + config.port : '') + config.relative_path; - if (config.port == '4567') delete config.port; - if (config.bcrypt_rounds == 12) delete config.bcrypt_rounds; - if (config.upload_path === '/public/uploads') delete config.upload_path; - if (config.bind_address === '0.0.0.0') delete config.bind_address; + if (config.port == '4567') { + delete config.port; + } + if (config.bcrypt_rounds == 12) { + delete config.bcrypt_rounds; + } + if (config.upload_path === '/public/uploads') { + delete config.upload_path; + } + if (config.bind_address === '0.0.0.0') { + delete config.bind_address; + } delete config.base_url; delete config.use_port; delete config.relative_path;