File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ var root = commandpost
40
40
var editorconfig = ! ! opts . editorconfig ;
41
41
var tsfmt = ! ! opts . tsfmt ;
42
42
43
- if ( args . files . length === 0 ) {
43
+ if ( args . files . length === 0 && ! opts . stdin ) {
44
44
process . stdout . write ( root . helpText ( ) + '\n' ) ;
45
45
return ;
46
46
}
@@ -54,8 +54,12 @@ var root = commandpost
54
54
}
55
55
56
56
if ( opts . stdin ) {
57
+ if ( opts . replace ) {
58
+ errorHandler ( "--stdin option can not use with --replace option" ) ;
59
+ return ;
60
+ }
57
61
lib
58
- . processStream ( args . files [ 0 ] , process . stdin , {
62
+ . processStream ( args . files [ 0 ] || "temp.ts" , process . stdin , {
59
63
replace : replace ,
60
64
tslint : tslint ,
61
65
editorconfig : editorconfig ,
@@ -89,4 +93,4 @@ function errorHandler(err:any) {
89
93
return Promise . resolve ( null ) . then ( ( ) => {
90
94
process . exit ( 1 ) ;
91
95
} ) ;
92
- }
96
+ }
You can’t perform that action at this time.
0 commit comments