File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ export abstract class SfCommand<T> extends Command {
153
153
public configAggregator ! : ConfigAggregator ;
154
154
155
155
private warnings : SfCommand . Warning [ ] = [ ] ;
156
+ private warningsToFlush : SfCommand . Warning [ ] = [ ] ;
156
157
private ux : Ux ;
157
158
private lifecycle : Lifecycle ;
158
159
@@ -330,7 +331,7 @@ export abstract class SfCommand<T> extends Command {
330
331
}
331
332
// eslint-disable-next-line @typescript-eslint/require-await
332
333
this . lifecycle . onWarning ( async ( warning : string ) => {
333
- this . warn ( warning ) ;
334
+ this . warningsToFlush . push ( warning ) ;
334
335
} ) ;
335
336
const options = {
336
337
Command : this . ctor ,
@@ -398,6 +399,14 @@ export abstract class SfCommand<T> extends Command {
398
399
throw sfCommandError ;
399
400
}
400
401
402
+ // eslint-disable-next-line @typescript-eslint/require-await
403
+ protected async finally ( ) : Promise < void > {
404
+ // flush warnings
405
+ this . warningsToFlush . forEach ( ( warning ) => {
406
+ this . warn ( warning ) ;
407
+ } ) ;
408
+ }
409
+
401
410
public abstract run ( ) : Promise < T > ;
402
411
}
403
412
You can’t perform that action at this time.
0 commit comments