-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
Errors with taskfile and windows #1723
Comments
Taskfile does not directly invoke bash/powershell on your system. Instead it uses a cross-platform shell written in Go called gosh. The syntax of this shell is POSIX/bash compliant, so you should use this syntax regardless as to whether you're on Windows or Linux. One problem you might encounter when trying to write cross-platform tasks is that If you really want to use Powershell on Windows, you can invoke it manually at the start of your command. e.g. my-task:
cmds:
- "powershell <my_powershell_cmd>" |
Although what you say is true, my problem is not that the commands such as rm, cp, etc. are different. My problem is that I can not put a small script as in the example It seems that even though this is the compiled for windows, the restriction that cmd has to be in POSIX/bash breaks the concept of multiplatform. I usually develop in Python, and the libreries I've collaborated with to execute something do this
|
It is not a restriction. You are able to run Powershell if you want to. It just needs to be invoked as mentioned. However, the whole point of using Have you tried just removing the |
Ouu you are absolutely right, I didn't think of taskfile this way. This approach is a marvel! I have seen a problem but it is with the semantic relese implementation for python, I will do a PR to fix it but it is nothing that matters here for this issue. The only drawback I see with this approach is the lack of applications, since writing in bash something you want to run on windows will surely fail for lack of commands like awk, grep, cp, etc. |
Agreed. The absence of some coreutils/builtins on some platforms is a known restriction and something we plan to address in the future (#197, mvdan/sh#93, mvdan/sh#97). In the meantime, it is possible to work around some of these issues by using the |
I have a Taskfile which I want to be compatible with both windows and linux, for this I have done the following:
Whether writing the windows part in powershell or in batch I run into sh validations with errors like
"for foo" must be followed by "in", "do", ;, or a newline
Is there any way to avoid these pre-validations for windows systems? Unfortunately I can't use Linux, WSL or git bash and I would like a more solid alternative to use commands in windows.
The text was updated successfully, but these errors were encountered: