File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ var root = commandpost
4040 var editorconfig = ! ! opts . editorconfig ;
4141 var tsfmt = ! ! opts . tsfmt ;
4242
43- if ( args . files . length === 0 ) {
43+ if ( args . files . length === 0 && ! opts . stdin ) {
4444 process . stdout . write ( root . helpText ( ) + '\n' ) ;
4545 return ;
4646 }
@@ -54,8 +54,12 @@ var root = commandpost
5454 }
5555
5656 if ( opts . stdin ) {
57+ if ( opts . replace ) {
58+ errorHandler ( "--stdin option can not use with --replace option" ) ;
59+ return ;
60+ }
5761 lib
58- . processStream ( args . files [ 0 ] , process . stdin , {
62+ . processStream ( args . files [ 0 ] || "temp.ts" , process . stdin , {
5963 replace : replace ,
6064 tslint : tslint ,
6165 editorconfig : editorconfig ,
@@ -89,4 +93,4 @@ function errorHandler(err:any) {
8993 return Promise . resolve ( null ) . then ( ( ) => {
9094 process . exit ( 1 ) ;
9195 } ) ;
92- }
96+ }
You can’t perform that action at this time.
0 commit comments