mirror of
https://github.com/go-task/task.git
synced 2025-01-26 05:27:15 +02:00
chore: sync translations (#1287)
This commit is contained in:
parent
c0d9c81393
commit
f219e1ee76
@ -17,7 +17,7 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
:::tip
|
||||
|
||||
If `--` is given, all remaning arguments will be assigned to a special `CLI_ARGS` variable
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@ -122,7 +122,7 @@ There are some special variables that is available on the templating system:
|
||||
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
|
||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
|
||||
| `TASK_VERSION` | The current version of task. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
||||
|
||||
## ENV
|
||||
|
||||
@ -146,12 +146,12 @@ Some environment variables can be overridden to adjust Task behavior.
|
||||
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
|
||||
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
|
||||
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
|
||||
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
|
||||
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
|
||||
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
|
||||
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
|
||||
|
@ -5,6 +5,13 @@ sidebar_position: 9
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.28.0 - 2023-07-24
|
||||
|
||||
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` ([#82](https://github.com/go-task/task/issues/82), [#1220](https://github.com/go-task/task/issues/1220) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed variable propagation in multi-level includes ([#778](https://github.com/go-task/task/issues/778), [#996](https://github.com/go-task/task/issues/996), [#1256](https://github.com/go-task/task/issues/1256) by [@hudclark](https://github.com/hudclark)).
|
||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly ([#1266](https://github.com/go-task/task/issues/1266), [#1270](https://github.com/go-task/task/issues/1270) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed a `nil` panic when a dependency was commented out or left empty ([#1263](https://github.com/go-task/task/issues/1263) by [@neomantra](https://github.com/neomantra)).
|
||||
|
||||
## v3.27.1 - 2023-06-30
|
||||
|
||||
- Fix panic when a `.env` directory (not file) is present on current directory ([#1244](https://github.com/go-task/task/issues/1244), [#1245](https://github.com/go-task/task/issues/1245) by [@pd93](https://github.com/pd93)).
|
||||
|
@ -900,7 +900,7 @@ tasks:
|
||||
|
||||
This will also work if you use globbing syntax in your sources. For example, if you specify a source for `*.txt`, the loop will iterate over all files that match that glob.
|
||||
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function:
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function. There are some [special variables](/api/#special-variables) that you may find useful for this.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -915,7 +915,7 @@ tasks:
|
||||
- bar.txt
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: cat {{ joinPath .MY_DIR .ITEM }}
|
||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
||||
```
|
||||
|
||||
### Looping over variables
|
||||
@ -928,11 +928,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
If you need to split on a different character, you can do this by specifying the `split` property:
|
||||
@ -943,12 +942,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt,bar.txt
|
||||
MY_VAR: foo.txt,bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
split: ','
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR, split: ',' }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
@ -959,12 +956,11 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var:
|
||||
MY_VAR:
|
||||
sh: find -type f -name '*.txt'
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
### Renaming variables
|
||||
@ -977,12 +973,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
as: FILE
|
||||
cmd: cat {{ .FILE }}
|
||||
- for: { var: MY_VAR, as: FILE }
|
||||
cmd: cat {{.FILE}}
|
||||
```
|
||||
|
||||
### Looping over tasks
|
||||
@ -998,11 +992,11 @@ tasks:
|
||||
- for: [foo, bar]
|
||||
task: my-task
|
||||
vars:
|
||||
FILE: '{{ .ITEM }}'
|
||||
FILE: '{{.ITEM}}'
|
||||
|
||||
my-task:
|
||||
cmds:
|
||||
- echo '{{ .FILE }}'
|
||||
- echo '{{.FILE}}'
|
||||
```
|
||||
|
||||
Or if you want to run different tasks depending on the value of the loop:
|
||||
@ -1014,7 +1008,7 @@ tasks:
|
||||
default:
|
||||
cmds:
|
||||
- for: [foo, bar]
|
||||
task: task-{{ .ITEM }}
|
||||
task: task-{{.ITEM}}
|
||||
|
||||
task-foo:
|
||||
cmds:
|
||||
|
@ -17,7 +17,7 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
:::tip
|
||||
|
||||
Si `--` est renseigné, tous les arguments suivants seront assigné à la variable spéciale `CLI_ARGS`
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@ -122,7 +122,7 @@ There are some special variables that is available on the templating system:
|
||||
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
|
||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
|
||||
| `TASK_VERSION` | The current version of task. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
||||
|
||||
## ENV
|
||||
|
||||
@ -146,12 +146,12 @@ Some environment variables can be overridden to adjust Task behavior.
|
||||
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
|
||||
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
|
||||
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
|
||||
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
|
||||
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
|
||||
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
|
||||
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
|
||||
|
@ -5,6 +5,13 @@ sidebar_position: 9
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.28.0 - 2023-07-24
|
||||
|
||||
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` ([#82](https://github.com/go-task/task/issues/82), [#1220](https://github.com/go-task/task/issues/1220) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed variable propagation in multi-level includes ([#778](https://github.com/go-task/task/issues/778), [#996](https://github.com/go-task/task/issues/996), [#1256](https://github.com/go-task/task/issues/1256) by [@hudclark](https://github.com/hudclark)).
|
||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly ([#1266](https://github.com/go-task/task/issues/1266), [#1270](https://github.com/go-task/task/issues/1270) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed a `nil` panic when a dependency was commented out or left empty ([#1263](https://github.com/go-task/task/issues/1263) by [@neomantra](https://github.com/neomantra)).
|
||||
|
||||
## v3.27.1 - 2023-06-30
|
||||
|
||||
- Fix panic when a `.env` directory (not file) is present on current directory ([#1244](https://github.com/go-task/task/issues/1244), [#1245](https://github.com/go-task/task/issues/1245) by [@pd93](https://github.com/pd93)).
|
||||
|
@ -900,7 +900,7 @@ tasks:
|
||||
|
||||
This will also work if you use globbing syntax in your sources. For example, if you specify a source for `*.txt`, the loop will iterate over all files that match that glob.
|
||||
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function:
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function. There are some [special variables](/api/#special-variables) that you may find useful for this.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -915,7 +915,7 @@ tasks:
|
||||
- bar.txt
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: cat {{ joinPath .MY_DIR .ITEM }}
|
||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
||||
```
|
||||
|
||||
### Looping over variables
|
||||
@ -928,11 +928,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
If you need to split on a different character, you can do this by specifying the `split` property:
|
||||
@ -943,12 +942,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt,bar.txt
|
||||
MY_VAR: foo.txt,bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
split: ','
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR, split: ',' }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
@ -959,12 +956,11 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var:
|
||||
MY_VAR:
|
||||
sh: find -type f -name '*.txt'
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
### Renaming variables
|
||||
@ -977,12 +973,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
as: FILE
|
||||
cmd: cat {{ .FILE }}
|
||||
- for: { var: MY_VAR, as: FILE }
|
||||
cmd: cat {{.FILE}}
|
||||
```
|
||||
|
||||
### Looping over tasks
|
||||
@ -998,11 +992,11 @@ tasks:
|
||||
- for: [foo, bar]
|
||||
task: my-task
|
||||
vars:
|
||||
FILE: '{{ .ITEM }}'
|
||||
FILE: '{{.ITEM}}'
|
||||
|
||||
my-task:
|
||||
cmds:
|
||||
- echo '{{ .FILE }}'
|
||||
- echo '{{.FILE}}'
|
||||
```
|
||||
|
||||
Or if you want to run different tasks depending on the value of the loop:
|
||||
@ -1014,7 +1008,7 @@ tasks:
|
||||
default:
|
||||
cmds:
|
||||
- for: [foo, bar]
|
||||
task: task-{{ .ITEM }}
|
||||
task: task-{{.ITEM}}
|
||||
|
||||
task-foo:
|
||||
cmds:
|
||||
|
@ -17,7 +17,7 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
:::tip
|
||||
|
||||
`--`が指定された場合、それ以降のすべての引数は特殊な`CLI_ARGS`変数に格納されます
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@ -122,7 +122,7 @@ There are some special variables that is available on the templating system:
|
||||
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
|
||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
|
||||
| `TASK_VERSION` | The current version of task. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
||||
|
||||
## ENV
|
||||
|
||||
@ -146,12 +146,12 @@ Some environment variables can be overridden to adjust Task behavior.
|
||||
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
|
||||
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
|
||||
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
|
||||
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
|
||||
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
|
||||
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
|
||||
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
|
||||
|
@ -5,6 +5,13 @@ sidebar_position: 9
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.28.0 - 2023-07-24
|
||||
|
||||
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` ([#82](https://github.com/go-task/task/issues/82), [#1220](https://github.com/go-task/task/issues/1220) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed variable propagation in multi-level includes ([#778](https://github.com/go-task/task/issues/778), [#996](https://github.com/go-task/task/issues/996), [#1256](https://github.com/go-task/task/issues/1256) by [@hudclark](https://github.com/hudclark)).
|
||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly ([#1266](https://github.com/go-task/task/issues/1266), [#1270](https://github.com/go-task/task/issues/1270) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed a `nil` panic when a dependency was commented out or left empty ([#1263](https://github.com/go-task/task/issues/1263) by [@neomantra](https://github.com/neomantra)).
|
||||
|
||||
## v3.27.1 - 2023-06-30
|
||||
|
||||
- Fix panic when a `.env` directory (not file) is present on current directory ([#1244](https://github.com/go-task/task/issues/1244), [#1245](https://github.com/go-task/task/issues/1245) by [@pd93](https://github.com/pd93)).
|
||||
|
@ -900,7 +900,7 @@ tasks:
|
||||
|
||||
This will also work if you use globbing syntax in your sources. For example, if you specify a source for `*.txt`, the loop will iterate over all files that match that glob.
|
||||
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function:
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function. There are some [special variables](/api/#special-variables) that you may find useful for this.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -915,7 +915,7 @@ tasks:
|
||||
- bar.txt
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: cat {{ joinPath .MY_DIR .ITEM }}
|
||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
||||
```
|
||||
|
||||
### Looping over variables
|
||||
@ -928,11 +928,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
If you need to split on a different character, you can do this by specifying the `split` property:
|
||||
@ -943,12 +942,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt,bar.txt
|
||||
MY_VAR: foo.txt,bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
split: ','
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR, split: ',' }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
@ -959,12 +956,11 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var:
|
||||
MY_VAR:
|
||||
sh: find -type f -name '*.txt'
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
### Renaming variables
|
||||
@ -977,12 +973,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
as: FILE
|
||||
cmd: cat {{ .FILE }}
|
||||
- for: { var: MY_VAR, as: FILE }
|
||||
cmd: cat {{.FILE}}
|
||||
```
|
||||
|
||||
### Looping over tasks
|
||||
@ -998,11 +992,11 @@ tasks:
|
||||
- for: [foo, bar]
|
||||
task: my-task
|
||||
vars:
|
||||
FILE: '{{ .ITEM }}'
|
||||
FILE: '{{.ITEM}}'
|
||||
|
||||
my-task:
|
||||
cmds:
|
||||
- echo '{{ .FILE }}'
|
||||
- echo '{{.FILE}}'
|
||||
```
|
||||
|
||||
Or if you want to run different tasks depending on the value of the loop:
|
||||
@ -1014,7 +1008,7 @@ tasks:
|
||||
default:
|
||||
cmds:
|
||||
- for: [foo, bar]
|
||||
task: task-{{ .ITEM }}
|
||||
task: task-{{.ITEM}}
|
||||
|
||||
task-foo:
|
||||
cmds:
|
||||
|
@ -17,7 +17,7 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
:::tip
|
||||
|
||||
Se `--` é informado, todos os argumentos remanescentes serão atribuídos a uma variável especial chamada `CLI_ARGS`
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@ -122,7 +122,7 @@ Há algumas variáveis especiais que são acessíveis via template:
|
||||
| `CHECKSUM` | O "checksum" dos arquivos listados em `sources`. Apenas disponível dentro do atributo `status` e se o método estiver configurado como `checksum`. |
|
||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Apenas disponível dentro do atributo `status` e se o método estiver configurado como `timestamp`. |
|
||||
| `TASK_VERSION` | A versão atual do Task. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
||||
|
||||
## ENV
|
||||
|
||||
@ -142,21 +142,21 @@ Some environment variables can be overridden to adjust Task behavior.
|
||||
|
||||
## Esquema do Taskfile
|
||||
|
||||
| Atributo | Tipo | Padrão | Descrição |
|
||||
| ---------- | ---------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Versão do Taskfile. A versão mais atual é a `3`. |
|
||||
| `output` | `string` | `interleaved` | Mode de saída. Opções disponíveis: `interleaved`, `group` e `prefixed`. |
|
||||
| `method` | `string` | `checksum` | O método padrão deste Taskfile. Pode ser sobre-escrito em cada tarefa individual. Opções disponíveis: `checksum` (conteúdo dos arquivos), `timestamp` (data/hora de modificação) e `none` (nenhum). |
|
||||
| `includes` | [`map[string]Include`](#include) | | Taskfiles adicionais a serem incluídos. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | Um conjunto de variáveis globais. |
|
||||
| `env` | [`map[string]Variable`](#variable) | | Um conjunto de variáveis de ambiente globais. |
|
||||
| `tasks` | [`map[string]Task`](#task) | | Um conjunto de tarefas. |
|
||||
| `silent` | `bool` | `false` | Opção padrão para `silent` para este Taskfile. Se `false`, pode ser sobre-escrito com `true` em cada tarefa individual. |
|
||||
| `dotenv` | `[]string` | | Uma lista de arquivos `.env` para serem incluídos. |
|
||||
| `run` | `string` | `always` | Opção padrão para `run` para este Taskfile. Opções disponíveis: `always` (sempre), `once` (uma vez) e `when_changed` (quando mudou). |
|
||||
| `interval` | `string` | `5s` | Configura um intervalo de tempo diferente para `--watch`, sendo que o padrão é de 5 segundos. Essa string deve ser um [Go Duration](https://pkg.go.dev/time#ParseDuration) válido. |
|
||||
| `set` | `[]string` | | Configura opções para o builtin [`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
|
||||
| `shopt` | `[]string` | | Configura opções para o builtin [`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
|
||||
| Atributo | Tipo | Padrão | Descrição |
|
||||
| ---------- | ---------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Versão do Taskfile. A versão mais atual é a `3`. |
|
||||
| `output` | `string` | `interleaved` | Mode de saída. Opções disponíveis: `interleaved`, `group` e `prefixed`. |
|
||||
| `method` | `string` | `checksum` | O método padrão deste Taskfile. Can be overridden in a task by task basis. Opções disponíveis: `checksum` (conteúdo dos arquivos), `timestamp` (data/hora de modificação) e `none` (nenhum). |
|
||||
| `includes` | [`map[string]Include`](#include) | | Taskfiles adicionais a serem incluídos. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | Um conjunto de variáveis globais. |
|
||||
| `env` | [`map[string]Variable`](#variable) | | Um conjunto de variáveis de ambiente globais. |
|
||||
| `tasks` | [`map[string]Task`](#task) | | Um conjunto de tarefas. |
|
||||
| `silent` | `bool` | `false` | Opção padrão para `silent` para este Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
|
||||
| `dotenv` | `[]string` | | Uma lista de arquivos `.env` para serem incluídos. |
|
||||
| `run` | `string` | `always` | Opção padrão para `run` para este Taskfile. Opções disponíveis: `always` (sempre), `once` (uma vez) e `when_changed` (quando mudou). |
|
||||
| `interval` | `string` | `5s` | Configura um intervalo de tempo diferente para `--watch`, sendo que o padrão é de 5 segundos. Essa string deve ser um [Go Duration](https://pkg.go.dev/time#ParseDuration) válido. |
|
||||
| `set` | `[]string` | | Configura opções para o builtin [`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
|
||||
| `shopt` | `[]string` | | Configura opções para o builtin [`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
|
||||
|
||||
### Include
|
||||
|
||||
|
@ -5,6 +5,13 @@ sidebar_position: 9
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.28.0 - 2023-07-24
|
||||
|
||||
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` ([#82](https://github.com/go-task/task/issues/82), [#1220](https://github.com/go-task/task/issues/1220) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed variable propagation in multi-level includes ([#778](https://github.com/go-task/task/issues/778), [#996](https://github.com/go-task/task/issues/996), [#1256](https://github.com/go-task/task/issues/1256) by [@hudclark](https://github.com/hudclark)).
|
||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly ([#1266](https://github.com/go-task/task/issues/1266), [#1270](https://github.com/go-task/task/issues/1270) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed a `nil` panic when a dependency was commented out or left empty ([#1263](https://github.com/go-task/task/issues/1263) by [@neomantra](https://github.com/neomantra)).
|
||||
|
||||
## v3.27.1 - 2023-06-30
|
||||
|
||||
- Fix panic when a `.env` directory (not file) is present on current directory ([#1244](https://github.com/go-task/task/issues/1244), [#1245](https://github.com/go-task/task/issues/1245) by [@pd93](https://github.com/pd93)).
|
||||
|
@ -900,7 +900,7 @@ tasks:
|
||||
|
||||
This will also work if you use globbing syntax in your sources. For example, if you specify a source for `*.txt`, the loop will iterate over all files that match that glob.
|
||||
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function:
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function. There are some [special variables](/api/#special-variables) that you may find useful for this.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -915,7 +915,7 @@ tasks:
|
||||
- bar.txt
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: cat {{ joinPath .MY_DIR .ITEM }}
|
||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
||||
```
|
||||
|
||||
### Looping over variables
|
||||
@ -928,11 +928,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
If you need to split on a different character, you can do this by specifying the `split` property:
|
||||
@ -943,12 +942,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt,bar.txt
|
||||
MY_VAR: foo.txt,bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
split: ','
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR, split: ',' }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
@ -959,12 +956,11 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var:
|
||||
MY_VAR:
|
||||
sh: find -type f -name '*.txt'
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
### Renaming variables
|
||||
@ -977,12 +973,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
as: FILE
|
||||
cmd: cat {{ .FILE }}
|
||||
- for: { var: MY_VAR, as: FILE }
|
||||
cmd: cat {{.FILE}}
|
||||
```
|
||||
|
||||
### Looping over tasks
|
||||
@ -998,11 +992,11 @@ tasks:
|
||||
- for: [foo, bar]
|
||||
task: my-task
|
||||
vars:
|
||||
FILE: '{{ .ITEM }}'
|
||||
FILE: '{{.ITEM}}'
|
||||
|
||||
my-task:
|
||||
cmds:
|
||||
- echo '{{ .FILE }}'
|
||||
- echo '{{.FILE}}'
|
||||
```
|
||||
|
||||
Or if you want to run different tasks depending on the value of the loop:
|
||||
@ -1014,7 +1008,7 @@ tasks:
|
||||
default:
|
||||
cmds:
|
||||
- for: [foo, bar]
|
||||
task: task-{{ .ITEM }}
|
||||
task: task-{{.ITEM}}
|
||||
|
||||
task-foo:
|
||||
cmds:
|
||||
|
@ -17,7 +17,7 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
:::tip
|
||||
|
||||
If `--` is given, all remaning arguments will be assigned to a special `CLI_ARGS` variable
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@ -122,7 +122,7 @@ There are some special variables that is available on the templating system:
|
||||
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
|
||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
|
||||
| `TASK_VERSION` | The current version of task. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
||||
|
||||
## ENV
|
||||
|
||||
@ -146,12 +146,12 @@ Some environment variables can be overridden to adjust Task behavior.
|
||||
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
|
||||
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
|
||||
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
|
||||
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
|
||||
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
|
||||
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
|
||||
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
|
||||
|
@ -5,6 +5,13 @@ sidebar_position: 9
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.28.0 - 2023-07-24
|
||||
|
||||
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` ([#82](https://github.com/go-task/task/issues/82), [#1220](https://github.com/go-task/task/issues/1220) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed variable propagation in multi-level includes ([#778](https://github.com/go-task/task/issues/778), [#996](https://github.com/go-task/task/issues/996), [#1256](https://github.com/go-task/task/issues/1256) by [@hudclark](https://github.com/hudclark)).
|
||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly ([#1266](https://github.com/go-task/task/issues/1266), [#1270](https://github.com/go-task/task/issues/1270) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed a `nil` panic when a dependency was commented out or left empty ([#1263](https://github.com/go-task/task/issues/1263) by [@neomantra](https://github.com/neomantra)).
|
||||
|
||||
## v3.27.1 - 2023-06-30
|
||||
|
||||
- Fix panic when a `.env` directory (not file) is present on current directory ([#1244](https://github.com/go-task/task/issues/1244), [#1245](https://github.com/go-task/task/issues/1245) by [@pd93](https://github.com/pd93)).
|
||||
|
@ -900,7 +900,7 @@ tasks:
|
||||
|
||||
This will also work if you use globbing syntax in your sources. For example, if you specify a source for `*.txt`, the loop will iterate over all files that match that glob.
|
||||
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function:
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function. There are some [special variables](/api/#special-variables) that you may find useful for this.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -915,7 +915,7 @@ tasks:
|
||||
- bar.txt
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: cat {{ joinPath .MY_DIR .ITEM }}
|
||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
||||
```
|
||||
|
||||
### Looping over variables
|
||||
@ -928,11 +928,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
If you need to split on a different character, you can do this by specifying the `split` property:
|
||||
@ -943,12 +942,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt,bar.txt
|
||||
MY_VAR: foo.txt,bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
split: ','
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR, split: ',' }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
@ -959,12 +956,11 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var:
|
||||
MY_VAR:
|
||||
sh: find -type f -name '*.txt'
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
### Renaming variables
|
||||
@ -977,12 +973,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
as: FILE
|
||||
cmd: cat {{ .FILE }}
|
||||
- for: { var: MY_VAR, as: FILE }
|
||||
cmd: cat {{.FILE}}
|
||||
```
|
||||
|
||||
### Looping over tasks
|
||||
@ -998,11 +992,11 @@ tasks:
|
||||
- for: [foo, bar]
|
||||
task: my-task
|
||||
vars:
|
||||
FILE: '{{ .ITEM }}'
|
||||
FILE: '{{.ITEM}}'
|
||||
|
||||
my-task:
|
||||
cmds:
|
||||
- echo '{{ .FILE }}'
|
||||
- echo '{{.FILE}}'
|
||||
```
|
||||
|
||||
Or if you want to run different tasks depending on the value of the loop:
|
||||
@ -1014,7 +1008,7 @@ tasks:
|
||||
default:
|
||||
cmds:
|
||||
- for: [foo, bar]
|
||||
task: task-{{ .ITEM }}
|
||||
task: task-{{.ITEM}}
|
||||
|
||||
task-foo:
|
||||
cmds:
|
||||
|
@ -17,7 +17,7 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
:::tip
|
||||
|
||||
If `--` is given, all remaning arguments will be assigned to a special `CLI_ARGS` variable
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@ -122,7 +122,7 @@ There are some special variables that is available on the templating system:
|
||||
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
|
||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
|
||||
| `TASK_VERSION` | The current version of task. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
||||
|
||||
## ENV
|
||||
|
||||
@ -146,12 +146,12 @@ Some environment variables can be overridden to adjust Task behavior.
|
||||
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
|
||||
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
||||
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
|
||||
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
|
||||
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
|
||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
|
||||
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
|
||||
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
|
||||
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
|
||||
|
@ -5,6 +5,13 @@ sidebar_position: 9
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.28.0 - 2023-07-24
|
||||
|
||||
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` ([#82](https://github.com/go-task/task/issues/82), [#1220](https://github.com/go-task/task/issues/1220) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed variable propagation in multi-level includes ([#778](https://github.com/go-task/task/issues/778), [#996](https://github.com/go-task/task/issues/996), [#1256](https://github.com/go-task/task/issues/1256) by [@hudclark](https://github.com/hudclark)).
|
||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly ([#1266](https://github.com/go-task/task/issues/1266), [#1270](https://github.com/go-task/task/issues/1270) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed a `nil` panic when a dependency was commented out or left empty ([#1263](https://github.com/go-task/task/issues/1263) by [@neomantra](https://github.com/neomantra)).
|
||||
|
||||
## v3.27.1 - 2023-06-30
|
||||
|
||||
- Fix panic when a `.env` directory (not file) is present on current directory ([#1244](https://github.com/go-task/task/issues/1244), [#1245](https://github.com/go-task/task/issues/1245) by [@pd93](https://github.com/pd93)).
|
||||
|
@ -3,19 +3,19 @@ slug: /experiments/
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# Experiments
|
||||
# Deneyler
|
||||
|
||||
:::caution
|
||||
|
||||
All experimental features are subject to breaking changes and/or removal _at any time_. We strongly recommend that you do not use these features in a production environment. They are intended for testing and feedback only.
|
||||
Tüm deneysel özellikler, _herhangi bir zamanda_ önemli değişikliklere ve/veya kaldırmaya tabidir. Bu özellikleri bir üretim ortamında kullanmamanızı kesinlikle öneririz. Yanlızca test ve geri bildirim amaçlıdır.
|
||||
|
||||
:::
|
||||
|
||||
In order to allow Task to evolve quickly, we roll out breaking changes to minor versions behind experimental flags. This allows us to gather feedback on breaking changes before committing to a major release. This document describes the current set of experimental features and the deprecated feature that they are intended to replace.
|
||||
Task'ın hızlı bir şekilde gelişmesine izin vermek için, deneysel bayrakların arkasındaki küçük sürümlerde büyük değişiklikler yapıyoruz. Bu, büyük bir sürüm yayınlanmadan önce son değişiklikler hakkında geri bildirim toplamamızı sağlar. Bu belgede, mevcut deneysel özellik grubu ve bunların yerini alması amaçlanan kullanımdan kaldırılmış özellik açıklanmaktadır.
|
||||
|
||||
You can enable an experimental feature by:
|
||||
Deneysel bir özelliği şu şekilde etkinleştirebilirsiniz:
|
||||
|
||||
1. Using the relevant environment variable in front of a task command. For example, `TASK_X_{FEATURE}=1 task {my-task}`. This is intended for one-off invocations of Task to test out experimental features.
|
||||
1. İlgili ortam değişkenini bir görev komutunun önünde kullanma. Örneğin, `TASK_X_{FEATURE}=1 task {my-task}`. Bu, Task'ın deneysel özellikleri test etmek için tek seferlik çağrıları için tasarlanmıştır.
|
||||
1. Using the relevant environment variable in your "dotfiles" (e.g. `.bashrc`, `.zshrc` etc.). This is intended for permanently enabling experimental features in your environment.
|
||||
1. Creating a `.env` file in the same directory as your root Taskfile that contains the relevant environment variables. e.g.
|
||||
|
||||
|
@ -900,7 +900,7 @@ tasks:
|
||||
|
||||
This will also work if you use globbing syntax in your sources. For example, if you specify a source for `*.txt`, the loop will iterate over all files that match that glob.
|
||||
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function:
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function. There are some [special variables](/api/#special-variables) that you may find useful for this.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -915,7 +915,7 @@ tasks:
|
||||
- bar.txt
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: cat {{ joinPath .MY_DIR .ITEM }}
|
||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
||||
```
|
||||
|
||||
### Looping over variables
|
||||
@ -928,11 +928,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
If you need to split on a different character, you can do this by specifying the `split` property:
|
||||
@ -943,12 +942,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt,bar.txt
|
||||
MY_VAR: foo.txt,bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
split: ','
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR, split: ',' }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
@ -959,12 +956,11 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var:
|
||||
MY_VAR:
|
||||
sh: find -type f -name '*.txt'
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
### Renaming variables
|
||||
@ -977,12 +973,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
as: FILE
|
||||
cmd: cat {{ .FILE }}
|
||||
- for: { var: MY_VAR, as: FILE }
|
||||
cmd: cat {{.FILE}}
|
||||
```
|
||||
|
||||
### Looping over tasks
|
||||
@ -998,11 +992,11 @@ tasks:
|
||||
- for: [foo, bar]
|
||||
task: my-task
|
||||
vars:
|
||||
FILE: '{{ .ITEM }}'
|
||||
FILE: '{{.ITEM}}'
|
||||
|
||||
my-task:
|
||||
cmds:
|
||||
- echo '{{ .FILE }}'
|
||||
- echo '{{.FILE}}'
|
||||
```
|
||||
|
||||
Or if you want to run different tasks depending on the value of the loop:
|
||||
@ -1014,7 +1008,7 @@ tasks:
|
||||
default:
|
||||
cmds:
|
||||
- for: [foo, bar]
|
||||
task: task-{{ .ITEM }}
|
||||
task: task-{{.ITEM}}
|
||||
|
||||
task-foo:
|
||||
cmds:
|
||||
|
@ -17,7 +17,7 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
:::tip
|
||||
|
||||
如果 `--` 给出,所有剩余参数将被分配给一个特殊的 `CLI_ARGS` 变量
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@ -61,20 +61,20 @@ Task 有时会以特定的退出代码退出。 These codes are split into three
|
||||
|
||||
可以在下面找到退出代码及其描述的完整列表:
|
||||
|
||||
| 代码 | 描述 |
|
||||
| --- | --------------------------------------------------------- |
|
||||
| 0 | 成功 |
|
||||
| 1 | 出现未知错误 |
|
||||
| 100 | 找不到 Taskfile |
|
||||
| 101 | 尝试初始化一个 Taskfile 时已经存在 |
|
||||
| 102 | Taskfile 无效或无法解析 |
|
||||
| 200 | 找不到指定的 task |
|
||||
| 201 | 在 task 中执行命令时出错 |
|
||||
| 202 | 用户试图调用内部 task |
|
||||
| 203 | 有多个具有相同名称或别名的 task |
|
||||
| 204 | 一个 task 被调用了太多次 |
|
||||
| 205 | A task was cancelled by the user |
|
||||
| 206 | A task was not executed due to missing required variables |
|
||||
| 代码 | 描述 |
|
||||
| --- | ---------------------- |
|
||||
| 0 | 成功 |
|
||||
| 1 | 出现未知错误 |
|
||||
| 100 | 找不到 Taskfile |
|
||||
| 101 | 尝试初始化一个 Taskfile 时已经存在 |
|
||||
| 102 | Taskfile 无效或无法解析 |
|
||||
| 200 | 找不到指定的 task |
|
||||
| 201 | 在 task 中执行命令时出错 |
|
||||
| 202 | 用户试图调用内部 task |
|
||||
| 203 | 有多个具有相同名称或别名的 task |
|
||||
| 204 | 一个 task 被调用了太多次 |
|
||||
| 205 | 操作被用户取消 |
|
||||
| 206 | 由于缺少所需变量,任务未执行 |
|
||||
|
||||
这些代码也可以在代码库的 [`errors/errors.go`](https://github.com/go-task/task/blob/main/errors/errors.go) 文件中找到。
|
||||
|
||||
@ -122,7 +122,7 @@ Task 有时会以特定的退出代码退出。 These codes are split into three
|
||||
| `CHECKSUM` | 在 `sources` 中列出的文件的 checksum。 仅在 `status` 参数中可用,并且如果 method 设置为 `checksum`。 |
|
||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. 仅在 `status` 参数中可用,并且如果 method 设置为 `timestamp`。 |
|
||||
| `TASK_VERSION` | Task 的当前版本。 |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. |
|
||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
||||
|
||||
## 环境变量
|
||||
|
||||
@ -146,12 +146,12 @@ Some environment variables can be overridden to adjust Task behavior.
|
||||
| ---------- | ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Taskfile 的版本。 当前版本是 `3`。 |
|
||||
| `output` | `string` | `interleaved` | 输出模式。 可用选项: `interleaved`、`group` 和 `prefixed` |
|
||||
| `method` | `string` | `checksum` | Taskfile 中的默认方法。 可以在 task 基础上覆盖。 可用选项:`checksum`、`timestamp` 和 `none`。 |
|
||||
| `method` | `string` | `checksum` | Taskfile 中的默认方法。 Can be overridden in a task by task basis. 可用选项:`checksum`、`timestamp` 和 `none`。 |
|
||||
| `includes` | [`map[string]Include`](#include) | | 要包含的其他 Taskfile。 |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | 一组全局变量。 |
|
||||
| `env` | [`map[string]Variable`](#variable) | | 一组全局环境变量。 |
|
||||
| `tasks` | [`map[string]Task`](#task) | | 一组 task 定义。 |
|
||||
| `silent` | `bool` | `false` | 此 Taskfile 的默认“silent”选项。 如果为 `false`,则可以在 task 的基础上用 `true` 覆盖。 |
|
||||
| `silent` | `bool` | `false` | 此 Taskfile 的默认“silent”选项。 If `false`, can be overridden with `true` in a task by task basis. |
|
||||
| `dotenv` | `[]string` | | 要解析的 `.env` 文件路径列表。 |
|
||||
| `run` | `string` | `always` | Taskfile 中默认的 'run' 选项。 可用选项: `always`、`once` 和 `when_changed`。 |
|
||||
| `interval` | `string` | `5s` | 设置 `--watch` 模式下的观察时间,默认 5 秒。 这个字符串应该是一个有效的 [Go Duration](https://pkg.go.dev/time#ParseDuration)。 |
|
||||
|
@ -5,6 +5,13 @@ sidebar_position: 9
|
||||
|
||||
# 更新日志
|
||||
|
||||
## v3.28.0 - 2023-07-24
|
||||
|
||||
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` ([#82](https://github.com/go-task/task/issues/82), [#1220](https://github.com/go-task/task/issues/1220) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed variable propagation in multi-level includes ([#778](https://github.com/go-task/task/issues/778), [#996](https://github.com/go-task/task/issues/996), [#1256](https://github.com/go-task/task/issues/1256) by [@hudclark](https://github.com/hudclark)).
|
||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly ([#1266](https://github.com/go-task/task/issues/1266), [#1270](https://github.com/go-task/task/issues/1270) by [@pd93](https://github.com/pd93)).
|
||||
- Fixed a `nil` panic when a dependency was commented out or left empty ([#1263](https://github.com/go-task/task/issues/1263) by [@neomantra](https://github.com/neomantra)).
|
||||
|
||||
## v3.27.1 - 2023-06-30
|
||||
|
||||
- Fix panic when a `.env` directory (not file) is present on current directory ([#1244](https://github.com/go-task/task/issues/1244), [#1245](https://github.com/go-task/task/issues/1245) by [@pd93](https://github.com/pd93)).
|
||||
|
@ -900,7 +900,7 @@ tasks:
|
||||
|
||||
This will also work if you use globbing syntax in your sources. For example, if you specify a source for `*.txt`, the loop will iterate over all files that match that glob.
|
||||
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function:
|
||||
Source paths will always be returned as paths relative to the task directory. If you need to convert this to an absolute path, you can use the built-in `joinPath` function. There are some [special variables](/api/#special-variables) that you may find useful for this.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -915,7 +915,7 @@ tasks:
|
||||
- bar.txt
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: cat {{ joinPath .MY_DIR .ITEM }}
|
||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
||||
```
|
||||
|
||||
### Looping over variables
|
||||
@ -928,11 +928,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
If you need to split on a different character, you can do this by specifying the `split` property:
|
||||
@ -943,12 +942,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt,bar.txt
|
||||
MY_VAR: foo.txt,bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
split: ','
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR, split: ',' }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
@ -959,12 +956,11 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var:
|
||||
MY_VAR:
|
||||
sh: find -type f -name '*.txt'
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
cmd: cat {{ .ITEM }}
|
||||
- for: { var: MY_VAR }
|
||||
cmd: cat {{.ITEM}}
|
||||
```
|
||||
|
||||
### Renaming variables
|
||||
@ -977,12 +973,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
vars:
|
||||
my_var: foo.txt bar.txt
|
||||
MY_VAR: foo.txt bar.txt
|
||||
cmds:
|
||||
- for:
|
||||
var: my_var
|
||||
as: FILE
|
||||
cmd: cat {{ .FILE }}
|
||||
- for: { var: MY_VAR, as: FILE }
|
||||
cmd: cat {{.FILE}}
|
||||
```
|
||||
|
||||
### Looping over tasks
|
||||
@ -998,11 +992,11 @@ tasks:
|
||||
- for: [foo, bar]
|
||||
task: my-task
|
||||
vars:
|
||||
FILE: '{{ .ITEM }}'
|
||||
FILE: '{{.ITEM}}'
|
||||
|
||||
my-task:
|
||||
cmds:
|
||||
- echo '{{ .FILE }}'
|
||||
- echo '{{.FILE}}'
|
||||
```
|
||||
|
||||
Or if you want to run different tasks depending on the value of the loop:
|
||||
@ -1014,7 +1008,7 @@ tasks:
|
||||
default:
|
||||
cmds:
|
||||
- for: [foo, bar]
|
||||
task: task-{{ .ITEM }}
|
||||
task: task-{{.ITEM}}
|
||||
|
||||
task-foo:
|
||||
cmds:
|
||||
|
Loading…
x
Reference in New Issue
Block a user