-
Notifications
You must be signed in to change notification settings - Fork 579
Description
I can't figure out how to write a cross-platform python
or node
shebang recipe. #!python
works on Windows, and #!/usr/bin/env python
works on Linux. But what works on both?
On Linux we can write a reliable shebang using: #!/usr/bin/env bash
or #!/usr/bin/env python3
It is expected that /usr/bin/env
will always exist at that path, and it will look up the positional argument on your $PATH
and call it.
I'm proposing that just can safely special-case this /usr/bin/env
prefix on Windows to behave the same: look up the positional argument on your $PATH and execute it. Essentially, on Windows, #!/usr/bin/env whatever
will be handled the way it handles #!whatever
today.
I can't think of a situation where it is desirable for /usr/bin/env
to either do something else on Windows, or to fail with an error. So I don't think special-casing will break anyone's use-case.