-
-
Save amynbe/c521bd9d22eb138a5810269a4a639c96 to your computer and use it in GitHub Desktop.
Cygwin shebang path converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This allows you to run shebang-based scripts in Cygwin with tools that | |
# require Windows paths, like the Windows build of python or the kotlin | |
# interpreter. | |
# put this file in /usr/local/bin/ and use it as a shebang like this: | |
# #!/usr/local/bin/wenv myWindowsTool.exe | |
if [ $# -eq 1 ] | |
then | |
env $1 | |
else | |
env $1 `cygpath -m -- $2` "${@:3}" ; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this. $# is always >1, so "then" is not executed. The test should check for a non-cygwin location. For example, I put windows python in ~/local/python311c.