#!/usr/bin/env node var program = require('commander'); var utils = require('../lib/utils'); var logging = require('../logging'); var knexMigrator; utils.getKnexMigrator({path: process.cwd()}) .then(function (KnexMigrator) { program .option('--mgpath ') .option('--force') .parse(process.argv); try { knexMigrator = new KnexMigrator({knexMigratorFilePath: program.mgpath, executedFromShell: true}); } catch (err) { logging.error(err); process.exit(1); } return knexMigrator.reset({force: program.force}) .then(function () { logging.info('Finished database reset!'); }); }) .catch(function (err) { logging.error(err); process.exit(1); });