Skip to content

Commit

Permalink
Fixed current file name
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Feb 11, 2024
1 parent 8b4d90c commit 22e267b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export async function run(): Promise<void> {
let newLineNumber = 0

for (const line of lines) {
if (line.startsWith('+++ b/')) {
currentFile = line.substring('+++ b/'.length)
continue
}

if (line.startsWith('@@')) {
// Parse and set the starting line numbers from the hunk header
const match = line.match(/-(\d+),\d+ \+(\d+),\d+/)
Expand Down

0 comments on commit 22e267b

Please sign in to comment.