Skip to content

fix(commands): ember-cli branding leaks through many error messages a… #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ This project is currently a prototype so there are many known issues. Just to me
- On Windows you need to run the `build` and `serve` commands with Admin permissions, otherwise the performance is not good.
- [Protractor](https://angular.github.io/protractor/) integration is missing.
- The initial installation as well as `ng new` take too long because of lots of npm dependencies.
- "ember" branding leaks through many error messages and help text.
- Many existing ember addons are not compatible with Angular apps built via angular-cli.


Expand Down
32 changes: 26 additions & 6 deletions lib/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,30 @@ var path = require('path');
var fs = require('fs');

module.exports = function (options) {
options.cli = {
name: 'ng',
root: path.join(__dirname, '..', '..'),
npmPackage: 'angular-cli'
};
return cli(options);
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
if (/version:/.test(string) || /warning:/.test(string)) {
return;
}
string = string.replace(/ember-cli/g, 'angular-cli');
string = string.replace(/ember/g, 'ng');
write.apply(process.stdout, arguments)
}
})(process.stdout.write);

process.stderr.write = (function(write) {
return function(string, encoding, fd) {
string = string.replace(/ember-cli/g, 'angular-cli');
string = string.replace(/ember/g, 'ng');
write.apply(process.stdout, arguments)
}
})(process.stderr.write);

options.cli = {
name: 'ng',
root: path.join(__dirname, '..', '..'),
npmPackage: 'angular-cli'
};

return cli(options);
};