cake-build/resources

Add build.sh version for Windows

tiesmaster opened this issue ยท 6 comments

Cake is an excellent tool, and the "Getting Started" guide and this repo really helps to get started. I just installed it in my toy project, and was really easy ๐Ÿ‘

However, the build.sh script seems only to be working on linux/osx, and not on Windows, since the build.ps1 is for that. However, with bash becoming more popular on Windows, and having that easily available with Git for Windows, people are starting to use that as a default shell more often. It would be nice if this repo would provide a canonical version for Windows of build.sh, or adjust the current one so it also works on Windows.

Could this be added, or do you accept a PR for that?

What bash are you using?

Tried bash for Windows 10 and it worked, current example assumes mono installed though for posix enviorments
image

The official Git for Windows, that contains bash as default shell. That's using the MSYS2 "version" of bash, so it's not the new Linux subsystem for Windows introduced in the anniversary update of Windows 10.

The benefit of using MSYS2 is that you don't need mono installed, so you can just use the desktop framework (but get the added benefit of using bash, if you're used to that).

I already tried removing the mono prefix, and then it's working. Probably MSYS2 can be detected using the environment variables, and then the mono prefix can be included conditionally. Would you be willing to accept a PR for something like that?

Would be very nice for this to work without requiring Mono installed.

Cool, so I'm not the only one ๐Ÿ˜‰

This shouldn't be too hard to fix. @devlead How is your stance on merging something like this?

I just ran into this issue again, and ported the bash version from this repo to Windows. The gist is here (I couldn't get the SCRIPT_ARGUMENTS to work).

https://gist.github.com/tiesmaster/486756281d2631d3c1828a22ca77804e

The .NET Tool runner is now the recommended way to run Cake scripts on all platforms, the bootstrapper became a lot simpler (a handful of lines of code), doesn't require Mono (runs on .NET Core) and the build.sh now works from the Git Bash on Windows/MSYSGIT.

Screenshot MSYSGIT running Cake

Closing this as resolved. Feel free to reopen if needed.