Use /usr/bin/env bash instead of /bin/bash in gh extension create#4203
Conversation
|
Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message. |
You're right. But we do control the execution mechanism for these scripts. So before executing a script, we could read the first line from it, and if it's |
Not being too lazy to explain the reason, but this SO answer pretty much said it: https://stackoverflow.com/a/16365367
As for myself, the motivation is that NixOS doesn't have
/bin/bash(only/bin/sh).Some other places that may need to update:
scriptfolder. They seems to be used by maintainers only but portability is always good.P.S. I'm not sure when a new release will come out, but before this PR gets merged (if even) and everyone update to the new version, there will be a lot of new plugins using
/bin/shand none of them will work without modification.I probably won't bother to make a PR to change the shebang for every plugin out there,
ghshould set a good example, even if the current way works for most people.