@@ -97,26 +97,39 @@ a=foo
9797echo $a
9898` ` `
9999
100- # # 'x' builtin command doesn't work on Windows
100+ # # Are shell core utilities available on Windows?
101101
102- The default shell on Windows (`cmd` and `powershell`) do not have commands like
103- ` rm` and `cp` available as builtins. This means that these commands won't work.
104- If you want to make your Taskfile fully cross-platform, you'll need to work
105- around this limitation using one of the following methods :
102+ The most common ones, yes. And we might add more in the future.
103+ This is possible because Task compiles a small set of core utilities in Go and
104+ enables them by default on Windows for greater compatibility.
106105
107- - Use the <span v-pre>`{{OS}}`</span> function to run an OS-specific script.
108- - Use something like
109- <span v-pre>`{{if eq OS "windows"}}powershell {{end}}<my_cmd>`</span> to
110- detect windows and run the command in Powershell directly.
111- - Use a shell on Windows that supports these commands as builtins, such as [Git
112- Bash][git-bash] or [WSL][wsl].
106+ It's possible to control whether these builtin core utilities are used or not
107+ with the [`TASK_CORE_UTILS`](/docs/reference/environment#task-core-utils)
108+ environment variable :
113109
114- We want to make improvements to this part of Task and the issues below track
115- this work. Constructive comments and contributions are very welcome!
110+ ` ` ` bash
111+ # Enable, even on non-Windows platforms
112+ env TASK_CORE_UTILS=1 task ...
116113
117- - # 197
118- - [mvdan/sh#93](https://github.com/mvdan/sh/issues/93)
119- - [mvdan/sh#97](https://github.com/mvdan/sh/issues/97)
114+ # Disable, even on Windows
115+ env TASK_CORE_UTILS=0 task ...
116+ ` ` `
120117
121- [git-bash] : https://gitforwindows.org/
122- [wsl] : https://learn.microsoft.com/en-us/windows/wsl/install
118+ This is the list of core utils that are currently available :
119+
120+ * `base64`
121+ * `cat`
122+ * `chmod`
123+ * `cp`
124+ * `find`
125+ * `gzip`
126+ * `ls`
127+ * `mkdir`
128+ * `mktemp`
129+ * `mv`
130+ * `rm`
131+ * `shasum`
132+ * `tar`
133+ * `touch`
134+ * `xargs`
135+ * (more might be added in the future)
0 commit comments