File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/commands/force/org/beta Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,8 @@ export class Create extends SfdxCommand {
263263
264264 private async setAliasAndDefaultUsername ( username : string ) : Promise < void > {
265265 if ( this . flags . setalias ) {
266- await Aliases . parseAndUpdate ( [ `${ this . flags . setalias as string } =${ username } ` ] ) ;
266+ const alias = await Aliases . create ( Aliases . getDefaultOptions ( ) ) ;
267+ await alias . updateValue ( this . flags . setalias , username ) ;
267268 this . logger . debug ( 'Set Alias: %s result: %s' , this . flags . setalias ) ;
268269 }
269270 if ( this . flags . setdefaultusername ) {
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ describe('org:create', () => {
198198 ...CREATE_RESULT ,
199199 username : 'newScratchUsername' ,
200200 } ) ;
201- const aliasStub = stubMethod ( sandbox , Aliases , 'parseAndUpdate ' ) ;
201+ const aliasStub = stubMethod ( sandbox , Aliases . prototype , 'updateValue ' ) ;
202202 const configStub = stubMethod ( sandbox , Config . prototype , 'set' ) ;
203203 await command . runIt ( ) ;
204204 expect ( prodOrg . firstCall . args [ 0 ] ) . to . deep . equal ( {
@@ -216,7 +216,7 @@ describe('org:create', () => {
216216 retry : 0 ,
217217 orgConfig : { } ,
218218 } ) ;
219- expect ( aliasStub . firstCall . args ) . to . deep . equal ( [ [ 'scratchOrgAlias= newScratchUsername' ] ] ) ;
219+ expect ( aliasStub . firstCall . args ) . to . deep . equal ( [ 'scratchOrgAlias' , ' newScratchUsername'] ) ;
220220 expect ( configStub . firstCall . args ) . to . deep . equal ( [ 'defaultusername' , 'newScratchUsername' ] ) ;
221221 } ) ;
222222
You can’t perform that action at this time.
0 commit comments