|
|
|
@ -451,7 +451,8 @@ var commands = {
|
|
|
|
|
|
|
|
|
|
return upgradeProc.on('close', function (err) {
|
|
|
|
|
if (err) {
|
|
|
|
|
process.stdout.write('\nError'.red + ': ' + err.message + '\n');
|
|
|
|
|
process.stdout.write('Error occurred during upgrade');
|
|
|
|
|
throw err;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -472,19 +473,21 @@ var commands = {
|
|
|
|
|
var upgradeProc = fork(arr);
|
|
|
|
|
|
|
|
|
|
upgradeProc.on('close', next);
|
|
|
|
|
upgradeProc.on('error', next);
|
|
|
|
|
},
|
|
|
|
|
], function (err) {
|
|
|
|
|
if (err) {
|
|
|
|
|
process.stdout.write('\nError'.red + ': ' + err.message + '\n');
|
|
|
|
|
} else {
|
|
|
|
|
var message = 'NodeBB Upgrade Complete!';
|
|
|
|
|
// some consoles will return undefined/zero columns, so just use 2 spaces in upgrade script if we can't get our column count
|
|
|
|
|
var columns = process.stdout.columns;
|
|
|
|
|
var spaces = columns ? new Array(Math.floor(columns / 2) - (message.length / 2) + 1).join(' ') : ' ';
|
|
|
|
|
|
|
|
|
|
process.stdout.write('OK\n'.green);
|
|
|
|
|
process.stdout.write('\n' + spaces + message.green.bold + '\n\n'.reset);
|
|
|
|
|
process.stdout.write('Error occurred during upgrade');
|
|
|
|
|
throw err;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var message = 'NodeBB Upgrade Complete!';
|
|
|
|
|
// some consoles will return undefined/zero columns, so just use 2 spaces in upgrade script if we can't get our column count
|
|
|
|
|
var columns = process.stdout.columns;
|
|
|
|
|
var spaces = columns ? new Array(Math.floor(columns / 2) - (message.length / 2) + 1).join(' ') : ' ';
|
|
|
|
|
|
|
|
|
|
process.stdout.write('OK\n'.green);
|
|
|
|
|
process.stdout.write('\n' + spaces + message.green.bold + '\n\n'.reset);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|