Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ jobs:
file: .tool-versions
run: echo "bun 1.1.0" > .tool-versions

- name: .tool-versions (bun1.1.0)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this format is not supported on asdf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should continue supporting this, even though it’s invalid, until the next major version so we don’t break semver

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I've updated the regex to use negative lookahead (?![a-zA-Z]) which:

  • Excludes bundler and similar patterns (the original bug)
  • Maintains backward compatibility for bun1.1.0 format (no space)
  • Keeps support for the standard bun 1.1.0 format

This approach preserves semver compatibility as @xhyrom suggested.

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
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const FILE_VERSION_READERS = {
return pkg.packageManager?.split("bun@")?.[1] ?? pkg.engines?.bun;
},
".tool-versions": (content: string) =>
content.match(/^bun\s+(?<version>.*?)$/m)?.groups?.version,
content.match(/^bun\s+(?<version>\S+)$/m)?.groups?.version,
".bumrc": (content: string) => content, // https://github.com/owenizedd/bum
".bun-version": (content: string) => content,
};
Expand Down