From c6eab3b4b297c1ce946f60984097138fb5d26fe6 Mon Sep 17 00:00:00 2001 From: jonathansadowski Date: Mon, 17 Oct 2022 13:48:56 -0500 Subject: [PATCH] Fix the match pattern for the version bump tool (#34982) * Update pattern in version bump tool to use two digits * Update README for version bump for pnpm7 parameter order --- tools/version-bump/README.md | 2 +- tools/version-bump/lib/update.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/version-bump/README.md b/tools/version-bump/README.md index b588a3fd586..3bb50735fd3 100644 --- a/tools/version-bump/README.md +++ b/tools/version-bump/README.md @@ -9,7 +9,7 @@ Bump WooCommerce to version 7.1.0: ``` -pnpm run version --filter version-bump -- bump woocommerce -v 7.1.0 +pnpm --filter version-bump run version bump woocommerce -v 7.1.0 ``` **Arguments**: diff --git a/tools/version-bump/lib/update.ts b/tools/version-bump/lib/update.ts index 527b466016b..e94235f4ed6 100644 --- a/tools/version-bump/lib/update.ts +++ b/tools/version-bump/lib/update.ts @@ -25,7 +25,7 @@ export const updateReadmeStableTag = async ( const readmeContents = await readFile( filePath, 'utf8' ); const updatedReadmeContents = readmeContents.replace( - /Stable tag: \d.\d.\d\n/m, + /Stable tag: \d+\.\d+\.\d+\n/m, `Stable tag: ${ nextVersion }\n` ); @@ -50,7 +50,7 @@ export const updateReadmeChangelog = async ( const readmeContents = await readFile( filePath, 'utf8' ); const updatedReadmeContents = readmeContents.replace( - /= \d.\d.\d \d\d\d\d-XX-XX =\n/m, + /= \d+\.\d+\.\d+ \d\d\d\d-XX-XX =\n/m, `= ${ nextVersion } ${ new Date().getFullYear() }-XX-XX =\n` ); @@ -86,7 +86,7 @@ export const updateClassPluginFile = async ( const classPluginFileContents = await readFile( filePath, 'utf8' ); const updatedClassPluginFileContents = classPluginFileContents.replace( - /public \$version = '\d.\d.\d';\n/m, + /public \$version = '\d+\.\d+\.\d+';\n/m, `public $version = '${ nextVersion }';\n` ); @@ -142,7 +142,7 @@ export const updatePluginFile = async ( const pluginFileContents = await readFile( filePath, 'utf8' ); const updatedPluginFileContents = pluginFileContents.replace( - /Version: \d.\d.\d.*\n/m, + /Version: \d+\.\d+\.\d+.*\n/m, `Version: ${ nextVersion }\n` ); await writeFile( filePath, updatedPluginFileContents );