added the logo

This commit is contained in:
AnatolyUss 2016-12-15 00:28:34 +02:00
parent 9b13e6c1df
commit 2040d70b69
4 changed files with 102 additions and 6 deletions

38
Logo.js Normal file
View file

@ -0,0 +1,38 @@
/*
* This file is a part of "NMIG" - the database migration tool.
*
* Copyright 2016 Anatoly Khaytovich <anatolyuss@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (please see the "LICENSE.md" file).
* If not, see <http://www.gnu.org/licenses/gpl.txt>.
*
* @author Anatoly Khaytovich <anatolyuss@gmail.com>
*/
'use strict';
/**
* Render the logo.
*
* @returns {undefined}
*/
module.exports = function() {
const logo = '\n\t/\\_ |\\ /\\/\\ /\\___'
+ '\n\t| \\ | |\\ | | | __'
+ '\n\t| |\\\\| || | | | \\_ \\'
+ '\n\t| | \\| || | | |__/ |'
+ '\n\t\\| \\/ /_|/______/'
+ '\n\n\tNMIG - the database migration tool'
+ '\n\tCopyright 2016 Anatoly Khaytovich <anatolyuss@gmail.com>\n\n';
console.log(logo);
};

View file

@ -0,0 +1,56 @@
/*
* This file is a part of "NMIG" - the database migration tool.
*
* Copyright 2016 Anatoly Khaytovich <anatolyuss@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (please see the "LICENSE.md" file).
* If not, see <http://www.gnu.org/licenses/gpl.txt>.
*
* @author Anatoly Khaytovich <anatolyuss@gmail.com>
*/
'use strict';
/**
* Boot the migration.
*
* @param {Conversion} self
*
* @returns {Promise}
*/
module.exports = function(self) {
return new Promise(resolve => {
const logo = '\n\t/\\_ |\\ /\\/\\ /\\___'
+ '\n\t| \\ | |\\ | | | __'
+ '\n\t| |\\\\| || | | | \\_ \\'
+ '\n\t| | \\| || | | |__/ |'
+ '\n\t\\| \\/ /_|/______/'
+ '\n\n\tNMIG - the database migration tool'
+ '\n\tCopyright 2016 Anatoly Khaytovich <anatolyuss@gmail.com>\n\n'
+ '\t--[boot] The configuration has been just loaded.'
+ '\n\t--[boot] NMIG is ready to start.\n\t--[boot] Proceed? [Y/n]';
console.log(logo);
process
.stdin
.resume()
.setEncoding(self._encoding)
.on('data', stdin => {
if (stdin.indexOf('Y') !== -1) {
resolve();
} else {
console.log('\t--[boot] Migration aborted.\n');
process.exit();
}
});
});
};

View file

@ -151,9 +151,10 @@ module.exports = function(self, tableName) {
return new Promise(resolve => {
const msg = '\t--[CommentsProcessor] Creates comments for table "' + self._schema + '"."' + tableName + '"...';
log(self, msg, self._dicTables[tableName].tableLogPath);
const tableCommentsPromise = processTableComments(self, tableName);
const columnsCommentsPromise = processColumnsComments(self, tableName);
Promise.all([tableCommentsPromise, columnsCommentsPromise]).then(() => resolve());
Promise.all([
processTableComments(self, tableName),
processColumnsComments(self, tableName)
]).then(() => resolve());
});
});
};

View file

@ -31,6 +31,7 @@ const dataPoolManager = require('./DataPoolManager');
const directoriesManager = require('./DirectoriesManager');
const loadStructureToMigrate = require('./StructureLoader');
const pipeData = require('./DataPipeManager');
const boot = require('./BootProcessor');
/**
* Runs migration according to user's configuration.
@ -40,10 +41,10 @@ const pipeData = require('./DataPipeManager');
* @returns {undefined}
*/
module.exports = function(config) {
console.log('\n\tNMIG - the database migration tool\n\tCopyright 2016 Anatoly Khaytovich <anatolyuss@gmail.com>\n\t Boot...');
const self = new Conversion(config);
readDataTypesMap(self).then(
boot(self).then(() => {
return readDataTypesMap(self);
}).then(
() => {
return directoriesManager.createLogsDirectory(self);
},