Skip to content

Commit 1a56466

Browse files
jkurifilipesilva
authored andcommitted
chore(commands): ember-cli branding leaks through many error messages and help text
Close #157
1 parent 0c996d1 commit 1a56466

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ This project is currently a prototype so there are many known issues. Just to me
121121
- On Windows you need to run the `build` and `serve` commands with Admin permissions, otherwise the performance is not good.
122122
- [Protractor](https://angular.github.io/protractor/) integration is missing.
123123
- The initial installation as well as `ng new` take too long because of lots of npm dependencies.
124-
- "ember" branding leaks through many error messages and help text.
125124
- Many existing ember addons are not compatible with Angular apps built via angular-cli.
126125

127126

lib/cli/index.js

+26-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,30 @@ var path = require('path');
33
var fs = require('fs');
44

55
module.exports = function (options) {
6-
options.cli = {
7-
name: 'ng',
8-
root: path.join(__dirname, '..', '..'),
9-
npmPackage: 'angular-cli'
10-
};
11-
return cli(options);
6+
process.stdout.write = (function(write) {
7+
return function(string, encoding, fd) {
8+
if (/version:/.test(string) || /warning:/.test(string)) {
9+
return;
10+
}
11+
string = string.replace(/ember-cli/g, 'angular-cli');
12+
string = string.replace(/ember/g, 'ng');
13+
write.apply(process.stdout, arguments)
14+
}
15+
})(process.stdout.write);
16+
17+
process.stderr.write = (function(write) {
18+
return function(string, encoding, fd) {
19+
string = string.replace(/ember-cli/g, 'angular-cli');
20+
string = string.replace(/ember/g, 'ng');
21+
write.apply(process.stdout, arguments)
22+
}
23+
})(process.stderr.write);
24+
25+
options.cli = {
26+
name: 'ng',
27+
root: path.join(__dirname, '..', '..'),
28+
npmPackage: 'angular-cli'
29+
};
30+
31+
return cli(options);
1232
};

0 commit comments

Comments
 (0)