1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const commander = require("commander");
|
4 | const check_1 = require("./commands/check");
|
5 | const deploy_1 = require("./commands/deploy");
|
6 | const chalk_1 = require("chalk");
|
7 | const lint_1 = require("./commands/lint");
|
8 | const pkg = require('../package.json');
|
9 | commander.version(pkg.version);
|
10 | commander
|
11 | .command('check')
|
12 | .description('Check your local environment')
|
13 | .action(check_1.checkCommand);
|
14 | commander
|
15 | .command('lint')
|
16 | .description('Lint the files in the current git repository')
|
17 | .option('--fix', 'Fix linting errors automatically if possible')
|
18 | .action(check_1.checkFirst(lint_1.lintCommand));
|
19 | commander
|
20 | .command('deploy')
|
21 | .description('Deploy one or more applications.')
|
22 | .option('--app <app>', 'Which app to deploy')
|
23 | .option('--all', 'Deploy all apps')
|
24 | .option('--production', 'Deploy to the production environment')
|
25 | .option('--same-branch', 'Use the branch to determine the environment')
|
26 | .action(check_1.checkFirst(deploy_1.deployCommand));
|
27 |
|
28 | commander.on('command:*', check_1.checkFirst(() => {
|
29 | console.log(chalk_1.default `Command {magenta ${commander.args.join(' ')}} not found.`);
|
30 | process.exit(1);
|
31 | }));
|
32 | commander.parse(process.argv);
|
33 |
|
34 | if (!process.argv.slice(2).length) {
|
35 | commander.help();
|
36 | }
|
37 |
|
\ | No newline at end of file |