mirror of
https://github.com/go-task/task.git
synced 2026-06-28 07:04:33 +00:00
chore: sync translations (#1287)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user