return null for default dataDir
This commit is contained in:
+4
-4
@@ -442,7 +442,7 @@ function waitForDnsPropagation(app, callback) {
|
||||
|
||||
function moveDataDir(app, sourceDir, callback) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof sourceDir, 'string');
|
||||
assert(sourceDir === null || typeof sourceDir === 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
let resolvedSourceDir = apps.getDataDir(app, sourceDir);
|
||||
@@ -697,12 +697,10 @@ function changeLocation(app, args, progressCallback, callback) {
|
||||
|
||||
function migrateDataDir(app, oldDataDir, progressCallback, callback) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof oldDataDir, 'string');
|
||||
assert(oldDataDir === null || typeof oldDataDir === 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
const dataDirChanged = oldDataDir !== app.dataDir;
|
||||
|
||||
async.series([
|
||||
progressCallback.bind(null, { percent: 10, message: 'Cleaning up old install' }),
|
||||
stopApp.bind(null, app, progressCallback),
|
||||
@@ -717,6 +715,8 @@ function migrateDataDir(app, oldDataDir, progressCallback, callback) {
|
||||
|
||||
// migrate dataDir
|
||||
function (next) {
|
||||
const dataDirChanged = oldDataDir !== app.dataDir;
|
||||
|
||||
if (!dataDirChanged) return next();
|
||||
|
||||
moveDataDir(app, oldDataDir, next);
|
||||
|
||||
Reference in New Issue
Block a user