Skip to content

gradle.js fix versionRegex to handle prerelease#265

Closed
atimonin wants to merge 2 commits intoabsolute-version:masterfrom
atimonin:fix/grale-updater-prerelease
Closed

gradle.js fix versionRegex to handle prerelease#265
atimonin wants to merge 2 commits intoabsolute-version:masterfrom
atimonin:fix/grale-updater-prerelease

Conversation

@atimonin
Copy link
Copy Markdown
Contributor

@atimonin atimonin commented Nov 20, 2025

Updater lib/updaters/types/gradle.js has too narrow regex for version: /^version\s+=\s+['"]([\d.]+)['"]/m, it handles only version like x.y.z while prerelease looks like x.y.z-pre.a (where x,y,z,a are numbers).
Change to /^version\s*=\s*['"]([\d.]+.*)['"]/m

@TimothyJones
Copy link
Copy Markdown
Member

Awesome, thanks for this! Would you be able to add a test too, to stop this recurring if we ever move away from the regex?

@atimonin
Copy link
Copy Markdown
Contributor Author

Awesome, thanks for this! Would you be able to add a test too, to stop this recurring if we ever move away from the regex?

Sorry for a long delay...
Unfortunately I'm not familiar with JS enough to write tests.
May you please merge it without tests?

@TimothyJones
Copy link
Copy Markdown
Member

Thanks to both @atimonin and @mnorlin , this is about to be released via #273

@TimothyJones
Copy link
Copy Markdown
Member

Published as 12.7.0, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants