From 3a291305ac56910478faa37c57fbbc3dce9c801e Mon Sep 17 00:00:00 2001 From: ronnnnn Date: Tue, 30 Jul 2024 19:22:10 +0900 Subject: [PATCH] update: allow more spaces for .tool-versions --- .github/workflows/test.yml | 4 ++++ src/utils.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ab606e..f083add 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,6 +97,10 @@ jobs: file: .tool-versions run: | echo "bun1.1.0" > .tool-versions + - name: .tool-versions (bun 1.1.0) + file: .tool-versions + run: | + echo "bun 1.1.0" > .tool-versions - name: .bumrc (1.1.0) file: .bumrc run: | diff --git a/src/utils.ts b/src/utils.ts index aea7160..a8b69c0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -31,7 +31,7 @@ const FILE_VERSION_READERS = { "package.json": (content: string) => JSON.parse(content).packageManager?.split("bun@")?.[1], ".tool-versions": (content: string) => - content.match(/^bun\s?(?.*?)$/m)?.groups?.version, + content.match(/^bun\s*(?.*?)$/m)?.groups?.version, ".bumrc": (content: string) => content, // https://github.com/owenizedd/bum ".bun-version": (content: string) => content, };