-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
MS-Windows: shell
might not invoke the expected executable in the contrived case of a file with a double executable extension
#1083
Comments
shell
might not invoke the expected executable in the contrived case of a file with a double extensionshell
might not invoke the expected executable in the contrived case of a file with a double executable extension
@ikappaki The latter one has been fixed on master an hour or so ago
You can test the fix with https://ci.appveyor.com/api/buildjobs/6n5ab26rede54lsw/artifacts/babashka-0.6.7-SNAPSHOT-windows-amd64.zip. About the |
Thanks! It was a contrived example trying out different ext combinations, but that commit has also fixed it too (you are one step ahead 😎) : D:\bbtest>.\bb.exe --version
babashka v0.6.7-SNAPSHOT
D:\bbtest>.\bb.exe "(:cmd (babashka.tasks/shell ""io.bat""))"
D:\bbtest>REM :1
["d:\\bbtest\\1\\io.bat"]
D:\bbtest>.\bb.exe "(:cmd (babashka.tasks/shell ""io.bat.bat""))"
D:\bbtest>REM :2
["d:\\bbtest\\1\\io.bat.bat"]
D:\bbtest>.\bb.exe "(:cmd (babashka.tasks/shell ""io""))"
D:\bbtest>REM :1
["d:\\bbtest\\1\\io.bat"]
D:\bbtest>.\bb.exe "(fs/which ""io.bat"")"
#object[sun.nio.fs.WindowsPath 0x3aac4678 "d:\\bbtest\\1\\io.bat"]
D:\bbtest>.\bb.exe "(fs/which ""io.bat.bat"")"
#object[sun.nio.fs.WindowsPath 0x62feb3d5 "d:\\bbtest\\1\\io.bat.bat"]
D:\bbtest>.\bb.exe "(fs/which ""io"")"
#object[sun.nio.fs.WindowsPath 0x42d0571f "d:\\bbtest\\1\\io.bat"] |
It seems |
Indeed. A few days back while I was doing the research for the original PR, I noticed that powershell does not include the current path when searching for the command to execute for security reasons:
IMHO is better to follow the *nix |
Cool, I'll leave it like this. Fixed another edge case on master. Will do another release. |
version
[ Please specify which version of babashka you're using. You can find this with
babashka --version
. The documentation on the master branch may be ahead of the most released version. ]babashka v0.6.6
[ Please specify which platform you are using babashka on, so you can test a
new binary when the issue is resolved. ]
MS-Windows 10
[ Please provide a short and to the point description of the problem ]
babashka.tasks/shell
does not invoke the executable with the expected extension, in the extreme case where there are two executables with the same name and extension, but one of them has the extension repeated once. i.e. the following invokesio.bat.bat
instead of the expectedio.bat
[ Please provide a minimal working reproduction of the problem ]
expected behavior
The same as if we invoke the same from the command prompt or the the first outcome of the
where
tool (i.e.io.bat
in the above contrived example).Also I've noticed that
fs\which
does not return the executable if given with the complete extension:but the following returns nothing
The text was updated successfully, but these errors were encountered: