-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
fix: run postinstall script explicitly with bash #4116
Conversation
Currently, Windows default script-shell (cmd) fails to run the postinstall script. This commit fixes the problem by running postinstall.sh explicitly with the default bash executable of the OS. Related: #1397
First, thank you @MaxLOh for adding this! 🎉 I think this is a great first step toward improving the support on Windows. I am not on expert in this realm, but I assume this shouldn't cause any issues on other platforms (macOS/Linux)? @code-asher I'll let you give the final approval since you have more expertise here. |
side note: don't worry about the docs preview failing, we need to look into that working on forks. See #4027 |
Codecov Report
@@ Coverage Diff @@
## main #4116 +/- ##
=======================================
Coverage 64.12% 64.12%
=======================================
Files 36 36
Lines 1873 1873
Branches 379 379
=======================================
Hits 1201 1201
Misses 571 571
Partials 101 101 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I guess cmd
must not take hashbangs into account. This change does make my senses tingle but I think it should be OK.
Long-term maybe we should rewrite this script to use Node.
You had me at Node 😍 But agreed, then we could write tests for it more easily |
@code-asher cmd does not recognize forward slashes. It tries to run
If we replace forward slashes with backslashes, Windows will open the .sh file with the associated application, which maybe a random text editor, if not bash.
To run the .sh file with the default bash command executable, we will need to run it explicitly with bash
|
This reverts commit b32b4ed.
Ohh that makes sense! Thank you for the clarification.
|
This reverts commit b32b4ed. We are reverting this because we found out that while this fixes the postinstall on Windows, it breaks it on mac and other devices. See: #3874 (comment)
Revert "fix: run postinstall script explicitly with bash (#4116)"
Currently, Windows default script-shell (cmd) fails to run the postinstall script.
This commit fixes the problem by running postinstall.sh explicitly with the default bash executable of the OS.
Related: #1397