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
This commit is contained in:
jonathansadowski 2022-10-17 13:48:56 -05:00 committed by GitHub
parent 868f581af8
commit c6eab3b4b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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**:

View File

@ -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 );