myt/myt-fixtures.js

30 lines
642 B
JavaScript
Raw Normal View History

2022-12-21 13:17:50 +00:00
const Myt = require('./myt');
const Command = require('./lib/command');
const Dumper = require('./lib/dumper');
2022-06-09 18:41:18 +00:00
class Fixtures extends Command {
static usage = {
description: 'Dumps local fixtures from database',
operand: 'remote'
};
2022-06-09 18:41:18 +00:00
static opts = {
default: {
remote: 'docker'
}
};
2022-06-09 18:41:18 +00:00
2022-12-21 13:17:50 +00:00
async run(myt, opts) {
const dumper = new Dumper(opts);
await dumper.init('fixtures.sql');
await dumper.dumpFixtures(opts.localFixtures, true);
await dumper.end();
2022-06-09 18:41:18 +00:00
}
}
module.exports = Fixtures;
if (require.main === module)
2022-12-21 13:17:50 +00:00
new Myt().run(Fixtures);
2022-06-09 18:41:18 +00:00