Match wrangler version even if multiline output cloudflare#277

This commit is contained in:
Andrew Patton 2024-07-11 11:34:09 -07:00
parent 93fff4f656
commit 47d51f25c1
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"wrangler-action": patch
---
fix: Detect existing wrangler install even when wrangler version output is multiline

View file

@ -104,7 +104,7 @@ async function installWrangler() {
// `3.48.0`
const versionMatch =
stdout.match(/wrangler (\d+\.\d+\.\d+)/) ??
stdout.match(/^(\d+\.\d+\.\d+)/);
stdout.match(/^(\d+\.\d+\.\d+)/m);
if (versionMatch) {
installedVersion = versionMatch[1];
}