File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 11import {
2- confirm ,
2+ text ,
33 intro ,
44 isCancel ,
55 multiselect ,
@@ -85,15 +85,27 @@ ${commitMessage}
8585${ chalk . grey ( '——————————————————' ) } `
8686 ) ;
8787
88- const isCommitConfirmedByUser =
89- skipCommitConfirmation ||
90- ( await confirm ( {
91- message : 'Confirm the commit message?'
92- } ) ) ;
88+ const userAction = skipCommitConfirmation
89+ ? 'Yes'
90+ : await select ( {
91+ message : 'Confirm the commit message?' ,
92+ options : [
93+ { value : 'Yes' , label : 'Yes' } ,
94+ { value : 'No' , label : 'No' } ,
95+ { value : 'Edit' , label : 'Edit' }
96+ ]
97+ } ) ;
98+
99+ if ( isCancel ( userAction ) ) process . exit ( 1 ) ;
93100
94- if ( isCancel ( isCommitConfirmedByUser ) ) process . exit ( 1 ) ;
101+ if ( userAction === 'Edit' ) {
102+ commitMessage = await text ( {
103+ message : 'Please edit the commit message: (press Enter to continue)' ,
104+ initialValue : commitMessage
105+ } ) ;
106+ }
95107
96- if ( isCommitConfirmedByUser ) {
108+ if ( userAction === 'Yes' || userAction === 'Edit' ) {
97109 const committingChangesSpinner = spinner ( ) ;
98110 committingChangesSpinner . start ( 'Committing the changes' ) ;
99111 const { stdout } = await execa ( 'git' , [
You can’t perform that action at this time.
0 commit comments