Skip to content

Commit

Permalink
Make patches work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Aug 9, 2023
1 parent 5ff897a commit 553dbe2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .autofix/fixers/update-lang-go.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ exports.register = async (fixers) => {

const patchVersionReplacements = {};
for (const line of stdout.split('\n').slice(1,-1)) {
const match = line.trim().match(/^go(\d+\.\d+\.)(\d+)$/);
const match = line.trim().match(/^go(\d+\.\d+)\.(\d+)$/);
if (!match) {
continue;
}

const pattern = match[1].replace(/\./g, '\\.') + '[0-9][0-9]*';
patchVersionReplacements[pattern] = 'go' + match[1] + match[2];
// Only capturing major and minor versions in the pattern
const pattern = match[1].replace(/\./g, '\\.') + '\\.[0-9][0-9]*';
patchVersionReplacements[pattern] = match[1] + '.' + match[2];
}

fixers[0].push({
Expand Down

0 comments on commit 553dbe2

Please sign in to comment.