1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const graphback_cli_1 = require("graphback-cli");
|
4 | exports.plugin = {
|
5 | init({ program, reportError }) {
|
6 | program
|
7 | .command('generate')
|
8 | .option('--db')
|
9 | .option('--backend')
|
10 | .option('--silent')
|
11 | .option('-w, --watch', 'Watch for changes and execute generation automatically')
|
12 | .action(async (cliFlags) => {
|
13 | try {
|
14 | if (cliFlags.backend) {
|
15 | await graphback_cli_1.generateUsingPlugins(cliFlags);
|
16 | }
|
17 | else if (cliFlags.db) {
|
18 | await graphback_cli_1.createDBResources({});
|
19 | }
|
20 | else {
|
21 | await graphback_cli_1.generateUsingPlugins(cliFlags);
|
22 | }
|
23 | }
|
24 | catch (e) {
|
25 | reportError(e);
|
26 | }
|
27 | });
|
28 | }
|
29 | };
|
30 |
|
\ | No newline at end of file |