File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -571,16 +571,18 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
571
571
572
572
/**
573
573
* Convenience function to handle typical side effects encountered when dealing with an AuthInfo.
574
- * Given the values supplied in parameter sideEffects, this functions will set auth alias, default auth
574
+ * Given the values supplied in parameter sideEffects, this function will set auth alias, default auth
575
575
* and default dev hub.
576
576
*
577
577
* @param sideEffects - instance of AuthSideEffects
578
578
*/
579
579
public async handleAliasAndDefaultSettings ( sideEffects : AuthSideEffects ) : Promise < void > {
580
- if ( sideEffects . alias ) await this . setAlias ( sideEffects . alias ) ;
581
- if ( sideEffects . setDefault ) await this . setAsDefault ( { org : true } ) ;
582
- if ( sideEffects . setDefaultDevHub ) await this . setAsDefault ( { devHub : true } ) ;
583
- await this . save ( ) ;
580
+ if ( sideEffects . alias || sideEffects . setDefault || sideEffects . setDefaultDevHub ) {
581
+ if ( sideEffects . alias ) await this . setAlias ( sideEffects . alias ) ;
582
+ if ( sideEffects . setDefault ) await this . setAsDefault ( { org : true } ) ;
583
+ if ( sideEffects . setDefaultDevHub ) await this . setAsDefault ( { devHub : true } ) ;
584
+ await this . save ( ) ;
585
+ }
584
586
}
585
587
586
588
/**
You can’t perform that action at this time.
0 commit comments