Skip to content
This repository was archived by the owner on Jul 21, 2022. It is now read-only.

Commit 7f0a3ce

Browse files
filipesilvaBrocco
authored andcommitted
fix: override ui write level
This method is more reliable than using regexes on the input/output streams. Fix angular#2540 Close angular#2627
1 parent d72b1eb commit 7f0a3ce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/angular-cli/lib/cli/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
// This file hooks up on require calls to transpile TypeScript.
44
const cli = require('ember-cli/lib/cli');
5+
const UI = require('ember-cli/lib/ui');
56
const path = require('path');
67

78
Error.stackTraceLimit = Infinity;
89

910
module.exports = function(options) {
11+
12+
// patch UI to not print Ember-CLI warnings (which don't apply to Angular-CLI)
13+
UI.prototype.writeWarnLine = function () { }
14+
1015
const oldStdoutWrite = process.stdout.write;
1116
process.stdout.write = function (line) {
1217
line = line.toString();
13-
if (line.match(/version:|WARNING:/)) {
14-
return;
15-
}
1618
if (line.match(/ember-cli-(inject-)?live-reload/)) {
1719
// don't replace 'ember-cli-live-reload' on ng init diffs
1820
return oldStdoutWrite.apply(process.stdout, arguments);
@@ -38,8 +40,6 @@ module.exports = function(options) {
3840

3941
// ensure the environemnt variable for dynamic paths
4042
process.env.PWD = process.env.PWD || process.cwd();
41-
42-
4343
process.env.CLI_ROOT = process.env.CLI_ROOT || path.resolve(__dirname, '..', '..');
4444

4545
return cli(options);

0 commit comments

Comments
 (0)