Skip to content

Commit 1349714

Browse files
committed
🐛 Add back missing quotes around message
1 parent 8435dd4 commit 1349714

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/commands/commit/withClient/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { type Answers } from '../prompts.js'
88
const 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
}

test/commands/commit.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

test/commands/stubs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const commitTitleInvalid = 'Invalid commit `title'
4242

4343
export 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

4949
export const clientCommitAnswersWithScope = {

0 commit comments

Comments
 (0)