[CLI] Support .0 versions, e.g. 6.4.0 #2848
Open
+178
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for the change, related issues
Allows CLI to load WordPress versions ending with
.0, such as6.8.0, by passing--wp=6.8.0.Before this PR, the only way to install exactly the
6.8.0version was passing the URL to the zip file.--wp=6.8.0would not work – the version string is used to construct the download URL (https://wordpress.org/wordpress-${versionQuery}.zip), but the actual zip file on WordPress.org is named6.8.zip, not6.8.0. At the same time, the string6.8is implicitly resolves to the latest point release, e.g.6.8.14.Resolves #2749
Implementation details
We just remove the trailing
.0before constructing the URL.It would be useful to avoid inferring the release URL entirely and request the 6.8.0 details directly from
https://api.wordpress.org/core/version-check/1.7/?channel=beta, I'm not sure how to do that. Any ideas @dd32?Testing Instructions (or ideally a Blueprint)
resolve-wordpress-release.spec.tsnode --no-warnings=ExperimentalWarning --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts server --wp=6.8.0and confirm WordPress 6.8.0 is getting installed