@@ -56,40 +56,32 @@ const MANDATORY_PARAMS = ['accessKeyId', 'secretAccessKey', 'region'];
5656
5757export function amplifyConfigure ( settings : AmplifyConfiguration ) : Promise < void > {
5858 const s = { ...defaultSettings , ...settings } ;
59- const missingParam = MANDATORY_PARAMS . filter ( p => ! Object . keys ( s ) . includes ( p ) ) ;
59+ const missingParam = MANDATORY_PARAMS . filter ( ( p ) => ! Object . keys ( s ) . includes ( p ) ) ;
6060 if ( missingParam . length ) {
6161 throw new Error ( `mandatory params ${ missingParam . join ( ' ' ) } are missing` ) ;
6262 }
6363
64- return new Promise ( ( resolve , reject ) => {
65- const chain = spawn ( getCLIPath ( ) , [ 'configure' ] , { stripColors : true } )
66- . wait ( 'Sign in to your AWS administrator account:' )
67- . wait ( 'Press Enter to continue' )
68- . sendCarriageReturn ( )
69- . wait ( 'Specify the AWS Region' ) ;
70-
71- singleSelect ( chain , s . region , amplifyRegions ) ;
72-
73- chain
74- . wait ( 'Press Enter to continue' )
75- . sendCarriageReturn ( )
76- . wait ( 'accessKeyId' )
77- . pauseRecording ( )
78- . sendLine ( s . accessKeyId )
79- . wait ( 'secretAccessKey' )
80- . sendLine ( s . secretAccessKey )
81- . resumeRecording ( )
82- . wait ( 'Profile Name:' )
83- . sendLine ( s . profileName )
84- . wait ( 'Successfully set up the new user.' )
85- . run ( ( err : Error ) => {
86- if ( ! err ) {
87- resolve ( ) ;
88- } else {
89- reject ( err ) ;
90- }
91- } ) ;
92- } ) ;
64+ const chain = spawn ( getCLIPath ( ) , [ 'configure' ] , { stripColors : true } )
65+ . wait ( 'Sign in to your AWS administrator account:' )
66+ . wait ( 'Press Enter to continue' )
67+ . sendCarriageReturn ( )
68+ . wait ( 'Specify the AWS Region' ) ;
69+
70+ singleSelect ( chain , s . region , amplifyRegions ) ;
71+
72+ return chain
73+ . wait ( 'Press Enter to continue' )
74+ . sendCarriageReturn ( )
75+ . wait ( 'accessKeyId' )
76+ . pauseRecording ( )
77+ . sendLine ( s . accessKeyId )
78+ . wait ( 'secretAccessKey' )
79+ . sendLine ( s . secretAccessKey )
80+ . resumeRecording ( )
81+ . wait ( 'Profile Name:' )
82+ . sendLine ( s . profileName )
83+ . wait ( 'Successfully set up the new user.' )
84+ . runAsync ( ) ;
9385}
9486
9587export function amplifyConfigureProject ( settings : {
0 commit comments