Skip to content

Commit

Permalink
better user message filter
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Sep 4, 2024
1 parent 33438c4 commit 12b8ccb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genaisrc/commit-msg.genai.mts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const msg = env.files[0]
const msgContent = msg.content
?.split(/\n/g)
.filter((l) => l && !/^# /.test(l))
.filter((l) => l && !/^#/.test(l))
.join("\n")
if (!msgContent) cancel("commit message already exists")
if (msgContent) cancel("commit message already exists")

// Check for staged changes and stage all changes if none are staged
let diff = await host.exec("git", ["diff", "--cached"])
Expand Down

0 comments on commit 12b8ccb

Please sign in to comment.