UNPKG

kns-cli

Version:

kns cli for hapi.js and sequelize.js

21 lines (16 loc) 586 B
var path = require("path"); var moment = require("moment"); var templatehelper = require("./templatehelper"); module.exports = function(dstPath, migrationName) { if ( migrationName.indexOf(".js") == -1 ) { migrationName += ".js"; } var time = moment().format("YYYYMMDDHHmmss"); migrationName = time + "-" + migrationName; var srcPath = path.join(__dirname, "../templates/floppy/migration_template.js"); var content = { filename: migrationName, date: time }; return templatehelper(srcPath, dstPath, migrationName, content); };