Skip to content

Commit 8cefc96

Browse files
authored
[skip changelog] Make i18n:generate task Windows compatible (#1360)
For the sake of portability of tasks, Task uses `mvdan.cc/sh` to provide an command interpreter that is independent of the environment. While one of the great strengths of Task, this produces unexpected results in some rare cases. This is one of those cases. There is some unusual interaction between `mvdan.cc/sh`, Windows, and running the `rice embed-go` command from the subshell created by the parentheses in this command: ``` $ task i18n:update ←[32mtask: [i18n:update] go run ./i18n/cmd/main.go catalog generate . > ./i18n/data/en.po ←[0m←[32mtask: [i18n:generate] git add -N ./i18n/data ←[0m←[32mtask: [i18n:generate] git diff --exit-code ./i18n/data &> /dev/null || (cd ./i18n && rice embed-go) ←[0merror reading package: go/build: go list github.com/arduino/arduino-cli/i18n: exec: "go": executable file not found in %PATH% ``` It is my belief that the sole purpose of these parentheses was to group the commands and that there is no need to run these commands in a subshell. If so, the change to using braces to group the commands without the creation of a subshell will have no functional effect on the commands, but will allow the task to run on Windows.
1 parent 1c65ebf commit 8cefc96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Taskfile.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ tasks:
214214
desc: Generate embedded i18n catalog files
215215
cmds:
216216
- git add -N ./i18n/data
217-
- git diff --exit-code ./i18n/data &> /dev/null || (cd ./i18n && rice embed-go)
217+
- git diff --exit-code ./i18n/data &> /dev/null || { cd ./i18n && rice embed-go; }
218218

219219
vars:
220220
PROJECT_NAME: "arduino-cli"

0 commit comments

Comments
 (0)