1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
16 | return new (P || (P = Promise))(function (resolve, reject) {
|
17 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
18 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
19 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
20 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
21 | });
|
22 | };
|
23 | Object.defineProperty(exports, "__esModule", { value: true });
|
24 |
|
25 |
|
26 | const logging = require("plylog");
|
27 | const updateNotifier = require("update-notifier");
|
28 | const polymer_cli_1 = require("./polymer-cli");
|
29 | const packageJson = require('../package.json');
|
30 | const logger = logging.getLogger('cli.main');
|
31 |
|
32 |
|
33 |
|
34 | updateNotifier({ pkg: packageJson }).notify();
|
35 | (() => __awaiter(this, void 0, void 0, function* () {
|
36 | const args = process.argv.slice(2);
|
37 | const cli = new polymer_cli_1.PolymerCli(args);
|
38 | try {
|
39 | const result = yield cli.run();
|
40 | if (result && result.constructor &&
|
41 | result.constructor.name === 'CommandResult') {
|
42 | process.exit(result.exitCode);
|
43 | }
|
44 | }
|
45 | catch (err) {
|
46 | logger.error('cli runtime exception: ' + err);
|
47 | if (err.stack) {
|
48 | logger.error(err.stack);
|
49 | }
|
50 | process.exit(1);
|
51 | }
|
52 | }))();
|
53 |
|
\ | No newline at end of file |