Skip to content
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

Check whole hashbang line if it is /usr/bin/env #66

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

Alduino
Copy link
Contributor

@Alduino Alduino commented Sep 8, 2021

Would fix #63.

Because pnpm uses the hashbang /usr/bin/env node, only checking until the first space as is current done will miss the node.

This change will only include the space if the text before the space is "/usr/bin/env", so that it doesn't break any existing code (/usr/bin/env would fail the check anyway)

This fix is working in my minimum reproduction of the issue (the Test stage)

Running it in the original repository that I found the bug in, it is getting past where it got before (it doesn't get the %1 is not a valid command error) but now at the end of the postinstall it gets another error (Install & Build stage):

apps/desktop postinstall: 'li.js" install-app-deps' is not recognized as an internal or external command,
apps/desktop postinstall: operable program or batch file.
apps/desktop postinstall:   • exited          command=app-builder.exe code=0 pid=6960
apps/desktop postinstall: D:\a\Muzik\Muzik\apps\desktop>li.js" install-app-deps

I'm not sure if that is caused by this change or not though, because there is no ground truth to compare to.

Because pnpm uses the hashbang `/usr/bin/env node`, only checking until the first space will miss the `node`. We only do this if it is the env call, so that it doesn't break any existing code (`/usr/bin/env` would fail the check anyway)
@develar
Copy link
Owner

develar commented Sep 14, 2021

Thanks!

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.

cannot execute pnpm.cjs: %1 is not a valid Win32 application.
2 participants