| 1 | "use strict";
|
|---|
| 2 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|---|
| 3 | // See LICENSE in the project root for license information.
|
|---|
| 4 | Object.defineProperty(exports, "__esModule", { value: true });
|
|---|
| 5 | const prune_1 = require("./prune");
|
|---|
| 6 | const suppress_1 = require("./suppress");
|
|---|
| 7 | const is_correct_cwd_1 = require("./utils/is-correct-cwd");
|
|---|
| 8 | const print_help_1 = require("./utils/print-help");
|
|---|
| 9 | if (process.argv.includes('-h') || process.argv.includes('-H') || process.argv.includes('--help')) {
|
|---|
| 10 | (0, print_help_1.printHelp)();
|
|---|
| 11 | process.exit(0);
|
|---|
| 12 | }
|
|---|
| 13 | if (process.argv.length < 3) {
|
|---|
| 14 | (0, print_help_1.printHelp)();
|
|---|
| 15 | process.exit(1);
|
|---|
| 16 | }
|
|---|
| 17 | if (!(0, is_correct_cwd_1.isCorrectCwd)(process.cwd())) {
|
|---|
| 18 | console.error('@rushstack/eslint-bulk: Please call this command from the directory that contains .eslintrc.js or .eslintrc.cjs');
|
|---|
| 19 | process.exit(1);
|
|---|
| 20 | }
|
|---|
| 21 | const subcommand = process.argv[2];
|
|---|
| 22 | let processPromise;
|
|---|
| 23 | switch (subcommand) {
|
|---|
| 24 | case 'suppress': {
|
|---|
| 25 | processPromise = (0, suppress_1.suppressAsync)();
|
|---|
| 26 | break;
|
|---|
| 27 | }
|
|---|
| 28 | case 'prune': {
|
|---|
| 29 | processPromise = (0, prune_1.pruneAsync)();
|
|---|
| 30 | break;
|
|---|
| 31 | }
|
|---|
| 32 | default: {
|
|---|
| 33 | console.error('@rushstack/eslint-bulk: Unknown subcommand: ' + subcommand);
|
|---|
| 34 | process.exit(1);
|
|---|
| 35 | }
|
|---|
| 36 | }
|
|---|
| 37 | processPromise.catch((e) => {
|
|---|
| 38 | if (e instanceof Error) {
|
|---|
| 39 | console.error(e.message);
|
|---|
| 40 | process.exit(1);
|
|---|
| 41 | }
|
|---|
| 42 | throw e;
|
|---|
| 43 | });
|
|---|
| 44 | //# sourceMappingURL=start.js.map |
|---|