Can I use bash commands in the YML for Windows?
I can't find a clear indication as to whether this *should* work or not?
Currently, by default commands are interpreted for a Windows image as CMD.
Putting sh: before the command, then leads to it being ignored.
Is that just something that isn't supported? To tailor AppVeyor to my needs I am making use of various bash commands, it's annoying to have ti duplicate all of this for batch.
I've installed WSL on my Windows machine, typing bash.exe from command prompt brings up the bash prompt.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Oliver Collyer on 07 Mar, 2020 10:14 AM
So I figured out how to make it work, but I would like to request that "sh:" be made a valid option for a Windows image.
But this doesn't:
Also, it only seems to work with Git bash and not the Windows Subsystem for Linux. For example, the following command fails with an error code of -1, for reasons I can't work out:
wsl -- echo this is bash
Likewise, if you configure the Windows machine to have Ubuntu installed and for "bash.exe" to path to the Ubuntu one, then again it fails with error -1.
This is all on Windows 10.
So my feature request is to make "sh:" work for Windows, so we don't have to have the ugly bash -c "blah" syntax, and secondly can it be made to work for WSL/Ubuntu bash etc too?
2 Posted by Eugen on 01 Apr, 2020 01:02 PM
Same issue here, i would need to run the command in WSL bash like in azure pipelines.
I'am not sure i understand your workarround
Is this supposed to work then?
3 Posted by Oliver Collyer on 01 Apr, 2020 01:14 PM
Not quite - you are running bash.exe as a ommand so you need to drop the sh: or replace it with a cmd:
I have this working nicely but you need to make sure that bash.exe is the one supplied with Windows git and not the one that is part of the Windows linux subsystem, as I found the latter did not work with Appveyor.