|
2 | 2 |
|
3 | 3 | // This file hooks up on require calls to transpile TypeScript.
|
4 | 4 | const cli = require('ember-cli/lib/cli');
|
| 5 | +const UI = require('ember-cli/lib/ui'); |
5 | 6 | const path = require('path');
|
6 | 7 |
|
7 | 8 | Error.stackTraceLimit = Infinity;
|
8 | 9 |
|
9 | 10 | module.exports = function(options) {
|
10 |
| - const oldStdoutWrite = process.stdout.write; |
11 |
| - process.stdout.write = function (line) { |
12 |
| - line = line.toString(); |
13 |
| - if (line.match(/version:|WARNING:/)) { |
14 |
| - return; |
15 |
| - } |
16 |
| - if (line.match(/ember-cli-(inject-)?live-reload/)) { |
17 |
| - // don't replace 'ember-cli-live-reload' on ng init diffs |
18 |
| - return oldStdoutWrite.apply(process.stdout, arguments); |
19 |
| - } |
20 |
| - line = line.replace(/ember-cli(?!.com)/g, 'angular-cli') |
21 |
| - .replace(/\bember\b(?!-cli.com)/g, 'ng'); |
22 |
| - return oldStdoutWrite.apply(process.stdout, arguments); |
23 |
| - }; |
24 | 11 |
|
25 |
| - const oldStderrWrite = process.stderr.write; |
26 |
| - process.stderr.write = function (line) { |
27 |
| - line = line.toString() |
28 |
| - .replace(/ember-cli(?!.com)/g, 'angular-cli') |
29 |
| - .replace(/\bember\b(?!-cli.com)/g, 'ng'); |
30 |
| - return oldStderrWrite.apply(process.stdout, arguments); |
31 |
| - }; |
| 12 | + // patch UI to not print Ember-CLI warnings (which don't apply to Angular-CLI) |
| 13 | + UI.prototype.writeWarnLine = function () { } |
32 | 14 |
|
33 | 15 | options.cli = {
|
34 | 16 | name: 'ng',
|
35 | 17 | root: path.join(__dirname, '..', '..'),
|
36 |
| - npmPackage: 'angular-cli' |
| 18 | + npmPackage: 'angular-cli', |
| 19 | + ui: UI |
37 | 20 | };
|
38 | 21 |
|
39 | 22 | // ensure the environemnt variable for dynamic paths
|
40 | 23 | process.env.PWD = process.env.PWD || process.cwd();
|
41 |
| - |
42 |
| - |
43 | 24 | process.env.CLI_ROOT = process.env.CLI_ROOT || path.resolve(__dirname, '..', '..');
|
44 | 25 |
|
45 | 26 | return cli(options);
|
|
0 commit comments