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 1
1
import {
2
- confirm ,
2
+ text ,
3
3
intro ,
4
4
isCancel ,
5
5
multiselect ,
@@ -85,15 +85,27 @@ ${commitMessage}
85
85
${ chalk . grey ( '——————————————————' ) } `
86
86
) ;
87
87
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 ) ;
93
100
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
+ }
95
107
96
- if ( isCommitConfirmedByUser ) {
108
+ if ( userAction === 'Yes' || userAction === 'Edit' ) {
97
109
const committingChangesSpinner = spinner ( ) ;
98
110
committingChangesSpinner . start ( 'Committing the changes' ) ;
99
111
const { stdout } = await execa ( 'git' , [
You can’t perform that action at this time.
0 commit comments