File tree 3 files changed +13
-4
lines changed
3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,10 @@ class EchoCommand extends Command {
10
10
const output = args . join ( ' ' ) ;
11
11
// Only write to stdout, never to stderr
12
12
if ( ! this . outputHandler . isStderr ) {
13
- this . outputHandler . write ( output ) ;
13
+ this . outputHandler . write ( output , true , true ) ;
14
14
} else {
15
15
// If stderr is redirected, write to stdout anyway
16
- console . log ( 'here dave' ) ;
17
- this . outputHandler . writeError ( output + '\n' ) ;
16
+ this . outputHandler . writeError ( output , true , true ) ;
18
17
}
19
18
return { shouldContinue : true } ;
20
19
}
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class OutputHandler {
65
65
}
66
66
}
67
67
68
- writeError ( message , newLine = true ) {
68
+ writeError ( message , newLine = true , printToOutput = false ) {
69
69
// If this is a stderr handler with redirection, write to file
70
70
if ( this . isStderr && this . outputFile ) {
71
71
// Ensure file is initialized first
@@ -75,6 +75,7 @@ class OutputHandler {
75
75
if ( this . fileInitialized ) {
76
76
const content = newLine ? message + '\n' : message ;
77
77
fs . appendFileSync ( this . outputFile , content ) ;
78
+ if ( printToOutput ) process . stdout . write ( content ) ;
78
79
} else {
79
80
// Fall back to stderr console
80
81
process . stderr . write ( newLine ? message + '\n' : message ) ;
Original file line number Diff line number Diff line change
1
+ david says error
2
+ dave stay
3
+ dave sta
4
+ dave dstas
5
+ dave eehe
6
+ dafdf fkjfk
7
+ dajbeb
8
+ ejfrklfj
9
+ ffkrgjrfk
You can’t perform that action at this time.
0 commit comments