New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Bun JavaScript Runtime #2377
Comments
I have not tested it, but the change is consistent with the existing code. 👍 Line 1548 in e517318
|
_@Whobeu drive by comment 😛 _ Create a patch and we can land. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have been experimenting with the new Bun JavaScript runtime and have found that yargs does not understand this new runtime. When referencing the $0 variable in yargs, it return "bun" instead of the script being run. As a quick hack, I modified index.cjs to include "bun" to the Regex statement:
/\b(node|iojs|electron)(\.exe)?$/
which becomes
/\b(node|iojs|electron|bun)(\.exe)?$/
This works and $0 now correctly reflects the script being executed. I would propose that a single line in yargs-factory.js be changed to the following so that index.cjs is updated with the new check:
if (/\b(node|iojs|electron|bun)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) {
The text was updated successfully, but these errors were encountered: