Open ssbarnea opened 1 month ago
Hey @ssbarnea,
Can we reliably detect that a Linux binary is ran under WSL? If so, we can consider adding another template function.
I wouldn't change the {{OS}}
function because, tecnically, it is running on Linux because WSL is Linux, and I'm certain people rely on the current behavior. If we changed it to return windows
it would break people's Taskfiles.
We can get some inspiration from https://github.com/scivision/detect-windows-subsystem-for-linux
There's potential to publish this on a standalone Go package on its own repository, so other people can benefit from it.
I like the idea @andreynering
This is something that will come really useful to support Windows devices as well as Linux and Mac, without fully rewriting a lot of task commands to use Powershell.
It seems that the platform is evaluated as "linux" instead of "windows" or at least something as "wsl" when you run taskfile on windows under wsl.
I am not totally surprised by this but it is still incorrect as it does not allow us to properly identify windows platform when we executed commands under wsl (we are forced to do that due to the build chain).