|
|
|
@ -129,11 +129,14 @@ Upgrade.process = function (files, skipCount, callback) {
|
|
|
|
|
date: date,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
process.stdout.write(' → '.white + String('[' + [date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate()].join('/') + '] ').gray + String(scriptExport.name).reset + '... ');
|
|
|
|
|
process.stdout.write(' → '.white + String('[' + [date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate()].join('/') + '] ').gray + String(scriptExport.name).reset + '...\n');
|
|
|
|
|
|
|
|
|
|
// For backwards compatibility, cross-reference with schemaDate (if found). If a script's date is older, skip it
|
|
|
|
|
if ((!results.schemaDate && !results.schemaLogCount) || (scriptExport.timestamp <= results.schemaDate && semver.lt(version, '1.5.0'))) {
|
|
|
|
|
process.stdout.write('skipped\n'.grey);
|
|
|
|
|
readline.clearLine(process.stdout, 0);
|
|
|
|
|
readline.cursorTo(process.stdout, 0);
|
|
|
|
|
readline.moveCursor(process.stdout, 0, -1);
|
|
|
|
|
process.stdout.write(' → '.white + String('[' + [date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate()].join('/') + '] ').gray + String(scriptExport.name).reset + '... ' + 'skipped\n'.grey);
|
|
|
|
|
db.sortedSetAdd('schemaLog', Date.now(), path.basename(file, '.js'), next);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -147,13 +150,11 @@ Upgrade.process = function (files, skipCount, callback) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (progress.total > 0) {
|
|
|
|
|
readline.clearLine(process.stdout, 0);
|
|
|
|
|
readline.cursorTo(process.stdout, 0);
|
|
|
|
|
process.stdout.write(' → '.white + String('[' + [date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate()].join('/') + '] ').gray + String(scriptExport.name).reset + '... ');
|
|
|
|
|
}
|
|
|
|
|
readline.clearLine(process.stdout, 0);
|
|
|
|
|
readline.cursorTo(process.stdout, 0);
|
|
|
|
|
readline.moveCursor(process.stdout, 0, -1);
|
|
|
|
|
process.stdout.write(' → '.white + String('[' + [date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate()].join('/') + '] ').gray + String(scriptExport.name).reset + '... ' + 'OK\n'.green);
|
|
|
|
|
|
|
|
|
|
process.stdout.write('OK\n'.green);
|
|
|
|
|
// Record success in schemaLog
|
|
|
|
|
db.sortedSetAdd('schemaLog', Date.now(), path.basename(file, '.js'), next);
|
|
|
|
|
});
|
|
|
|
|