File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
src/commands/commit/withClient Expand file tree Collapse file tree 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'
88const withClient = async ( answers : Answers ) : Promise < void > => {
99 try {
1010 const scope = answers . scope ? `(${ answers . scope } ): ` : ''
11- const title = `${ answers . gitmoji } ${ scope } ${ answers . title } `
11+ const title = `" ${ answers . gitmoji } ${ scope } ${ answers . title } " `
1212 const isAutoAddEnabled = configurationVault . getAutoAdd ( )
1313
1414 if ( await isHookCreated ( ) ) {
@@ -30,9 +30,10 @@ const withClient = async (answers: Answers): Promise<void> => {
3030 'commit' ,
3131 isAutoAddEnabled ? '-am' : '-m' ,
3232 title ,
33- ...( answers . message ? [ '-m' , answers . message ] : [ ] )
33+ ...( answers . message ? [ '-m' , `" ${ answers . message } "` ] : [ ] )
3434 ] ,
3535 {
36+ shell : true ,
3637 buffer : false ,
3738 stdio : 'inherit'
3839 }
Original file line number Diff line number Diff line change @@ -46,11 +46,12 @@ describe('commit command', () => {
4646 [
4747 'commit' ,
4848 '-m' ,
49- `${ stubs . clientCommitAnswers . gitmoji } ${ stubs . clientCommitAnswers . title } ` ,
49+ `" ${ stubs . clientCommitAnswers . gitmoji } ${ stubs . clientCommitAnswers . title } " ` ,
5050 '-m' ,
51- stubs . clientCommitAnswers . message
51+ `" ${ stubs . clientCommitAnswers . message } "`
5252 ] ,
5353 {
54+ shell : true ,
5455 buffer : false ,
5556 stdio : 'inherit'
5657 }
@@ -87,11 +88,12 @@ describe('commit command', () => {
8788 [
8889 'commit' ,
8990 '-am' ,
90- `${ stubs . clientCommitAnswersWithScope . gitmoji } (${ stubs . clientCommitAnswersWithScope . scope } ): ${ stubs . clientCommitAnswersWithScope . title } ` ,
91+ `" ${ stubs . clientCommitAnswersWithScope . gitmoji } (${ stubs . clientCommitAnswersWithScope . scope } ): ${ stubs . clientCommitAnswersWithScope . title } " ` ,
9192 '-m' ,
92- stubs . clientCommitAnswersWithScope . message
93+ `" ${ stubs . clientCommitAnswersWithScope . message } "`
9394 ] ,
9495 {
96+ shell : true ,
9597 buffer : false ,
9698 stdio : 'inherit'
9799 }
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ export const commitTitleInvalid = 'Invalid commit `title'
4242
4343export const clientCommitAnswers = {
4444 gitmoji : ':zap:' ,
45- title : 'Improving performance issues.' ,
46- message : 'Refactored code. Fixes #5'
45+ title : '" Improving performance issues." ' ,
46+ message : '" Refactored code. Fixes #5" '
4747}
4848
4949export const clientCommitAnswersWithScope = {
You can’t perform that action at this time.
0 commit comments