Skip to content

Commit 2837d33

Browse files
bump
1 parent 58688a1 commit 2837d33

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const gptCommit = async () => {
4343
const messages = [
4444
{role: "system", content: "You are a helpful assistant."},
4545
{role: "user", content: `Generate a Git commit message based on the following summary: ${gitSummary}\n\nCommit message: `}
46-
];
46+
];
4747

4848
const parameters = {
4949
model,
@@ -55,7 +55,7 @@ const gptCommit = async () => {
5555

5656
const response = await openai.chat.completions.create(parameters);
5757

58-
const message = response.choices[0].message.content.trim();
58+
const message = response.choices[0].message.content.replace(/[^\w\s]/gi, '').trim();
5959

6060
const confirm = await prompts({
6161
type: "confirm",
@@ -65,7 +65,7 @@ const gptCommit = async () => {
6565
});
6666

6767
if (confirm.value) {
68-
execSync(`git commit -m "${message.replace(/"/g, '\\"')}"`); // escape double quart
68+
execSync(`git commit -m "${message}"`); // escape double quart
6969
console.log("Committed with the suggested message.");
7070
} else {
7171
console.log("Commit canceled.");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@laststance/git-gpt-commit",
3-
"version": "0.7.0-beta07",
3+
"version": "0.7.0-beta08",
44
"description": "An AI-powered Git extension that generates commit messages using OpenAI's GPT-3, streamlining the commit process and improving developer productivity.",
55
"main": "index.js",
66
"type": "module",

0 commit comments

Comments
 (0)