forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-ngcc.ts
28 lines (27 loc) · 853 Bytes
/
main-ngcc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {mainNgcc} from './src/main';
import {parseCommandLineOptions} from './src/command_line_options';
// CLI entry point
process.title = 'ngcc';
const startTime = Date.now();
const options = parseCommandLineOptions(process.argv.slice(2));
(async () => {
try {
await mainNgcc(options);
if (options.logger) {
const duration = Math.round((Date.now() - startTime) / 1000);
options.logger.debug(`Run ngcc in ${duration}s.`);
}
process.exitCode = 0;
} catch (e: any) {
console.error((e as Error).stack || (e as Error).message);
process.exit(typeof e.code === 'number' ? e.code : 1);
}
})();