@@ -138,7 +138,8 @@ ${chalk.grey('——————————————————')}`
138
138
] ) ;
139
139
140
140
pushSpinner . stop (
141
- `${ chalk . green ( '✔' ) } Successfully pushed all commits to ${ remotes [ 0 ]
141
+ `${ chalk . green ( '✔' ) } Successfully pushed all commits to ${
142
+ remotes [ 0 ]
142
143
} `
143
144
) ;
144
145
@@ -148,23 +149,26 @@ ${chalk.grey('——————————————————')}`
148
149
process . exit ( 0 ) ;
149
150
}
150
151
} else {
151
- const skipOption = `don't push`
152
+ const skipOption = `don't push` ;
152
153
const selectedRemote = ( await select ( {
153
154
message : 'Choose a remote to push to' ,
154
- options : [ ...remotes , skipOption ] . map ( ( remote ) => ( { value : remote , label : remote } ) ) ,
155
+ options : [ ...remotes , skipOption ] . map ( ( remote ) => ( {
156
+ value : remote ,
157
+ label : remote
158
+ } ) )
155
159
} ) ) as string ;
156
160
157
161
if ( isCancel ( selectedRemote ) ) process . exit ( 1 ) ;
158
162
159
163
if ( selectedRemote !== skipOption ) {
160
164
const pushSpinner = spinner ( ) ;
161
-
165
+
162
166
pushSpinner . start ( `Running 'git push ${ selectedRemote } '` ) ;
163
-
167
+
164
168
const { stdout } = await execa ( 'git' , [ 'push' , selectedRemote ] ) ;
165
-
169
+
166
170
if ( stdout ) outro ( stdout ) ;
167
-
171
+
168
172
pushSpinner . stop (
169
173
`${ chalk . green (
170
174
'✔'
@@ -235,8 +239,9 @@ export async function commit(
235
239
236
240
stagedFilesSpinner . start ( 'Counting staged files' ) ;
237
241
238
- if ( ! stagedFiles . length ) {
242
+ if ( stagedFiles . length === 0 ) {
239
243
stagedFilesSpinner . stop ( 'No files are staged' ) ;
244
+
240
245
const isStageAllAndCommitConfirmedByUser = await confirm ( {
241
246
message : 'Do you want to stage all files and generate commit message?'
242
247
} ) ;
@@ -245,7 +250,7 @@ export async function commit(
245
250
246
251
if ( isStageAllAndCommitConfirmedByUser ) {
247
252
await commit ( extraArgs , context , true , fullGitMojiSpec ) ;
248
- process . exit ( 1 ) ;
253
+ process . exit ( 0 ) ;
249
254
}
250
255
251
256
if ( stagedFiles . length === 0 && changedFiles . length > 0 ) {
@@ -257,13 +262,13 @@ export async function commit(
257
262
} ) )
258
263
} ) ) as string [ ] ;
259
264
260
- if ( isCancel ( files ) ) process . exit ( 1 ) ;
265
+ if ( isCancel ( files ) ) process . exit ( 0 ) ;
261
266
262
267
await gitAdd ( { files } ) ;
263
268
}
264
269
265
270
await commit ( extraArgs , context , false , fullGitMojiSpec ) ;
266
- process . exit ( 1 ) ;
271
+ process . exit ( 0 ) ;
267
272
}
268
273
269
274
stagedFilesSpinner . stop (
0 commit comments