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 ( / v e r s i o n : | W A R N I N G : / ) ) {
14
- return ;
15
- }
16
- if ( line . match ( / e m b e r - c l i - ( i n j e c t - ) ? l i v e - r e l o a d / ) ) {
17
- // don't replace 'ember-cli-live-reload' on ng init diffs
18
- return oldStdoutWrite . apply ( process . stdout , arguments ) ;
19
- }
20
- line = line . replace ( / e m b e r - c l i (? ! .c o m ) / g, 'angular-cli' )
21
- . replace ( / \b e m b e r \b (? ! - c l i .c o m ) / 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 ( / e m b e r - c l i (? ! .c o m ) / g, 'angular-cli' )
29
- . replace ( / \b e m b e r \b (? ! - c l i .c o m ) / 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' ,
@@ -38,8 +20,6 @@ module.exports = function(options) {
38
20
39
21
// ensure the environemnt variable for dynamic paths
40
22
process . env . PWD = process . env . PWD || process . cwd ( ) ;
41
-
42
-
43
23
process . env . CLI_ROOT = process . env . CLI_ROOT || path . resolve ( __dirname , '..' , '..' ) ;
44
24
45
25
return cli ( options ) ;
0 commit comments