myt/myt-fixtures.js

29 lines
653 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(opts.dumpDir, '.fixtures');
await dumper.dumpFixtures(opts.localFixtures, false);
await dumper.end();
2022-06-09 18:41:18 +00:00
}
}
module.exports = Fixtures;
if (require.main === module)
new Myt().cli(Fixtures);