File tree 4 files changed +13
-30
lines changed
4 files changed +13
-30
lines changed Original file line number Diff line number Diff line change 6
6
import isAGitRepository from '../lib/isAGitRepository' ;
7
7
import * as console from '../lib/console' ;
8
8
import acp from '../lib/acp' ;
9
- import richPromopt from '../lib/richPrompt ' ;
9
+ import prompt from '../lib/prompt ' ;
10
10
11
11
export default async ( ) => {
12
12
if ( ! isAGitRepository ( ) ) {
13
13
console . error ( `not a git repository` ) ;
14
14
process . exit ( 1 ) ;
15
15
}
16
- const commitMessage = await richPromopt ( ) ;
16
+ const commitMessage = await prompt ( ) ;
17
17
acp ( commitMessage ) ;
18
18
} ;
Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ export default (commitMessage) => {
23
23
const commitCommand = `git commit -m "${ commitMessage } "` ;
24
24
console . info ( commitCommand ) ;
25
25
sh . exec ( commitCommand ) ;
26
- const pushCommand = `git push ${ getRemote ( ) } ${ getBranch ( ) } --tag` ;
27
- console . info ( pushCommand ) ;
28
- sh . exec ( pushCommand ) ;
26
+ // do not push when remove not exists
27
+ const remote = getRemote ( ) ;
28
+ if ( remote ) {
29
+ const pushCommand = `git push ${ remote } ${ getBranch ( ) } --tag` ;
30
+ console . info ( pushCommand ) ;
31
+ sh . exec ( pushCommand ) ;
32
+ }
29
33
} ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ export default async() => {
104
104
const body = wrap ( answers . body , wrapOptions ) ;
105
105
const footer = wrap ( answers . footer , wrapOptions ) ;
106
106
107
- return head + '\n\n' + body + '\n\n' + footer ;
107
+ const commitMessage = `${ head } \n\n${ body } \n\n${ footer } ` ;
108
+
109
+ // fix: '`' string in commit message causes command spilt
110
+ return commitMessage . replace ( / ` / g, `\\\`` ) ;
108
111
109
112
} ;
You can’t perform that action at this time.
0 commit comments