From 553dbe24869e09d1d6514410bef8cf79384f2a40 Mon Sep 17 00:00:00 2001 From: filiptronicek Date: Wed, 9 Aug 2023 08:28:20 +0000 Subject: [PATCH] Make patches work properly --- .autofix/fixers/update-lang-go.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.autofix/fixers/update-lang-go.js b/.autofix/fixers/update-lang-go.js index f42c81ce4..08ffc9ed1 100644 --- a/.autofix/fixers/update-lang-go.js +++ b/.autofix/fixers/update-lang-go.js @@ -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({