2022-12-21 13:17:50 +00:00
|
|
|
const Myt = require('./myt');
|
2022-12-21 12:34:17 +00:00
|
|
|
const Command = require('./lib/command');
|
2022-12-29 09:15:02 +00:00
|
|
|
const Dumper = require('./lib/dumper');
|
2022-06-09 18:41:18 +00:00
|
|
|
|
2022-12-21 12:34:17 +00:00
|
|
|
class Fixtures extends Command {
|
|
|
|
static usage = {
|
|
|
|
description: 'Dumps local fixtures from database',
|
|
|
|
operand: 'remote'
|
|
|
|
};
|
2022-06-09 18:41:18 +00:00
|
|
|
|
2022-12-29 09:15:02 +00:00
|
|
|
static opts = {
|
2022-12-21 12:34:17 +00:00
|
|
|
default: {
|
|
|
|
remote: 'docker'
|
|
|
|
}
|
|
|
|
};
|
2022-06-09 18:41:18 +00:00
|
|
|
|
2022-12-21 13:17:50 +00:00
|
|
|
async run(myt, opts) {
|
2022-12-29 09:15:02 +00:00
|
|
|
const dumper = new Dumper(opts);
|
2023-08-11 13:41:03 +00:00
|
|
|
await dumper.init(opts.dumpDir, '.fixtures');
|
|
|
|
await dumper.dumpFixtures(opts.localFixtures, false);
|
2022-12-29 09:15:02 +00:00
|
|
|
await dumper.end();
|
2022-06-09 18:41:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Fixtures;
|
|
|
|
|
|
|
|
if (require.main === module)
|
2024-01-04 12:02:40 +00:00
|
|
|
new Myt().cli(Fixtures);
|