File tree 3 files changed +11
-8
lines changed
src/commands/commit/withClient 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { type Answers } from '../prompts.js'
8
8
const withClient = async ( answers : Answers ) : Promise < void > => {
9
9
try {
10
10
const scope = answers . scope ? `(${ answers . scope } ): ` : ''
11
- const title = `${ answers . gitmoji } ${ scope } ${ answers . title } `
11
+ const title = `" ${ answers . gitmoji } ${ scope } ${ answers . title } " `
12
12
const isAutoAddEnabled = configurationVault . getAutoAdd ( )
13
13
14
14
if ( await isHookCreated ( ) ) {
@@ -30,9 +30,10 @@ const withClient = async (answers: Answers): Promise<void> => {
30
30
'commit' ,
31
31
isAutoAddEnabled ? '-am' : '-m' ,
32
32
title ,
33
- ...( answers . message ? [ '-m' , answers . message ] : [ ] )
33
+ ...( answers . message ? [ '-m' , `" ${ answers . message } "` ] : [ ] )
34
34
] ,
35
35
{
36
+ shell : true ,
36
37
buffer : false ,
37
38
stdio : 'inherit'
38
39
}
Original file line number Diff line number Diff line change @@ -46,11 +46,12 @@ describe('commit command', () => {
46
46
[
47
47
'commit' ,
48
48
'-m' ,
49
- `${ stubs . clientCommitAnswers . gitmoji } ${ stubs . clientCommitAnswers . title } ` ,
49
+ `" ${ stubs . clientCommitAnswers . gitmoji } ${ stubs . clientCommitAnswers . title } " ` ,
50
50
'-m' ,
51
- stubs . clientCommitAnswers . message
51
+ `" ${ stubs . clientCommitAnswers . message } "`
52
52
] ,
53
53
{
54
+ shell : true ,
54
55
buffer : false ,
55
56
stdio : 'inherit'
56
57
}
@@ -87,11 +88,12 @@ describe('commit command', () => {
87
88
[
88
89
'commit' ,
89
90
'-am' ,
90
- `${ stubs . clientCommitAnswersWithScope . gitmoji } (${ stubs . clientCommitAnswersWithScope . scope } ): ${ stubs . clientCommitAnswersWithScope . title } ` ,
91
+ `" ${ stubs . clientCommitAnswersWithScope . gitmoji } (${ stubs . clientCommitAnswersWithScope . scope } ): ${ stubs . clientCommitAnswersWithScope . title } " ` ,
91
92
'-m' ,
92
- stubs . clientCommitAnswersWithScope . message
93
+ `" ${ stubs . clientCommitAnswersWithScope . message } "`
93
94
] ,
94
95
{
96
+ shell : true ,
95
97
buffer : false ,
96
98
stdio : 'inherit'
97
99
}
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ export const commitTitleInvalid = 'Invalid commit `title'
42
42
43
43
export const clientCommitAnswers = {
44
44
gitmoji : ':zap:' ,
45
- title : 'Improving performance issues.' ,
46
- message : 'Refactored code. Fixes #5'
45
+ title : '" Improving performance issues." ' ,
46
+ message : '" Refactored code. Fixes #5" '
47
47
}
48
48
49
49
export const clientCommitAnswersWithScope = {
You can’t perform that action at this time.
0 commit comments