UNPKG

1.47 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const commander = require("commander");
4const check_1 = require("./commands/check");
5const deploy_1 = require("./commands/deploy");
6const chalk_1 = require("chalk");
7const lint_1 = require("./commands/lint");
8const pkg = require('../package.json');
9commander.version(pkg.version);
10commander
11 .command('check')
12 .description('Check your local environment')
13 .action(check_1.checkCommand);
14commander
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));
19commander
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// When the command isn't found, show an error.
28commander.on('command:*', check_1.checkFirst(() => {
29 console.log(chalk_1.default `Command {magenta ${commander.args.join(' ')}} not found.`);
30 process.exit(1);
31}));
32commander.parse(process.argv);
33// If there was no command (just 'burst') show help.
34if (!process.argv.slice(2).length) {
35 commander.help();
36}
37//# sourceMappingURL=index.js.map
\No newline at end of file