File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ interface ExecOptions {
22
22
abortSignal ?: AbortSignal ;
23
23
logOutput ?: boolean ;
24
24
trimArgs ?: boolean ;
25
+ neverThrow ?: boolean ;
25
26
}
26
27
27
28
export class Exec {
@@ -30,13 +31,15 @@ export class Exec {
30
31
31
32
private logOutput : boolean ;
32
33
private trimArgs : boolean ;
34
+ private neverThrow : boolean ;
33
35
34
36
constructor ( opts : ExecOptions ) {
35
37
this . logger = opts . logger ?? new SimpleLogger ( ) ;
36
38
this . abortSignal = opts . abortSignal ;
37
39
38
40
this . logOutput = opts . logOutput ?? true ;
39
41
this . trimArgs = opts . trimArgs ?? true ;
42
+ this . neverThrow = opts . neverThrow ?? false ;
40
43
}
41
44
42
45
async x (
@@ -68,7 +71,7 @@ export class Exec {
68
71
this . logger . debug ( `output: ${ commandWithFirstArg } ` , metadata ) ;
69
72
}
70
73
71
- if ( opts ?. neverThrow ) {
74
+ if ( this . neverThrow || opts ?. neverThrow ) {
72
75
return output ;
73
76
}
74
77
You can’t perform that action at this time.
0 commit comments