mirror of
https://github.com/go-task/task.git
synced 2025-05-27 23:08:16 +02:00
chore: sync translations (#1182)
This commit is contained in:
parent
ac96612a17
commit
62b52911fa
@ -2,9 +2,5 @@
|
||||
"version.label": {
|
||||
"message": "Suivant",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.tutorialSidebar.link.Chinese | 中国人": {
|
||||
"message": "Chinois | 中国人",
|
||||
"description": "The label for link Chinese | 中国人 in sidebar tutorialSidebar, linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
@ -272,9 +272,10 @@ tasks:
|
||||
#### Dependency
|
||||
|
||||
| Attribute | Type | Default | Description |
|
||||
| --------- | ---------------------------------- | ------- | -------------------------------------------------------- |
|
||||
| --------- | ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| `task` | `string` | | The task to be execute as a dependency. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
|
||||
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
|
||||
|
||||
:::tip
|
||||
|
||||
|
@ -5,6 +5,16 @@ sidebar_position: 8
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.25.0 - 2023-05-22
|
||||
|
||||
- Support `silent:` when calling another tasks ([#680](https://github.com/go-task/task/issues/680), [#1142](https://github.com/go-task/task/issues/1142) by [@danquah](https://github.com/danquah)).
|
||||
- Improve PowerShell completion script ([#1168](https://github.com/go-task/task/issues/1168) by [@trim21](https://github.com/trim21)).
|
||||
- Add more languages to the website menu and show translation progress percentage ([#1173](https://github.com/go-task/task/issues/1173) by [@misitebao](https://github.com/misitebao)).
|
||||
- Starting on this release, official binaries for FreeBSD will be available to download ([#1068](https://github.com/go-task/task/issues/1068) by [@andreynering](https://github.com/andreynering)).
|
||||
- Fix some errors being unintendedly supressed ([#1134](https://github.com/go-task/task/issues/1134) by [@clintmod](https://github.com/clintmod)).
|
||||
- Fix a nil pointer error when `version` is omitted from a Taskfile ([#1148](https://github.com/go-task/task/issues/1148), [#1149](https://github.com/go-task/task/issues/1149) by [@pd93](https://github.com/pd93)).
|
||||
- Fix duplicate error message when a task does not exists ([#1141](https://github.com/go-task/task/issues/1141), [#1144](https://github.com/go-task/task/issues/1144) by [@pd93](https://github.com/pd93)).
|
||||
|
||||
## v3.24.0 - 2023-04-15
|
||||
|
||||
- Fix Fish shell completion for tasks with aliases ([#1113](https://github.com/go-task/task/issues/1113) by [@patricksjackson](https://github.com/patricksjackson)).
|
||||
|
@ -405,6 +405,7 @@ tasks:
|
||||
vars: { TEXT: 'before 1' }
|
||||
- task: echo_sth
|
||||
vars: { TEXT: 'before 2' }
|
||||
silent: true
|
||||
cmds:
|
||||
- echo "after"
|
||||
|
||||
@ -503,7 +504,7 @@ tasks:
|
||||
- echo "Another task"
|
||||
```
|
||||
|
||||
Overriding variables in the called task is as simple as informing `vars` attribute:
|
||||
Using the `vars` and `silent` attributes you can choose to pass variables and toggle [silent mode](#silent-mode) on a call-by-call basis:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -519,6 +520,7 @@ tasks:
|
||||
cmds:
|
||||
- task: greet
|
||||
vars: { RECIPIENT: 'Cruel World' }
|
||||
silent: true
|
||||
```
|
||||
|
||||
The above syntax is also supported in `deps`.
|
||||
|
@ -42,9 +42,5 @@
|
||||
"link.item.label.OpenCollective": {
|
||||
"message": "OpenCollective",
|
||||
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
|
||||
},
|
||||
"link.item.label.Chinese | 中国人": {
|
||||
"message": "Chinois | 中国人",
|
||||
"description": "The label of footer link with label=Chinese | 中国人 linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,5 @@
|
||||
"version.label": {
|
||||
"message": "Próximo",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.tutorialSidebar.link.Chinese | 中国人": {
|
||||
"message": "Chinês | 中国人",
|
||||
"description": "The label for link Chinese | 中国人 in sidebar tutorialSidebar, linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
@ -272,9 +272,10 @@ tasks:
|
||||
#### Dependency
|
||||
|
||||
| Attribute | Type | Default | Description |
|
||||
| --------- | ---------------------------------- | ------- | -------------------------------------------------------- |
|
||||
| --------- | ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| `task` | `string` | | The task to be execute as a dependency. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
|
||||
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
|
||||
|
||||
:::tip
|
||||
|
||||
|
@ -5,6 +5,16 @@ sidebar_position: 8
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.25.0 - 2023-05-22
|
||||
|
||||
- Support `silent:` when calling another tasks ([#680](https://github.com/go-task/task/issues/680), [#1142](https://github.com/go-task/task/issues/1142) by [@danquah](https://github.com/danquah)).
|
||||
- Improve PowerShell completion script ([#1168](https://github.com/go-task/task/issues/1168) by [@trim21](https://github.com/trim21)).
|
||||
- Add more languages to the website menu and show translation progress percentage ([#1173](https://github.com/go-task/task/issues/1173) by [@misitebao](https://github.com/misitebao)).
|
||||
- Starting on this release, official binaries for FreeBSD will be available to download ([#1068](https://github.com/go-task/task/issues/1068) by [@andreynering](https://github.com/andreynering)).
|
||||
- Fix some errors being unintendedly supressed ([#1134](https://github.com/go-task/task/issues/1134) by [@clintmod](https://github.com/clintmod)).
|
||||
- Fix a nil pointer error when `version` is omitted from a Taskfile ([#1148](https://github.com/go-task/task/issues/1148), [#1149](https://github.com/go-task/task/issues/1149) by [@pd93](https://github.com/pd93)).
|
||||
- Fix duplicate error message when a task does not exists ([#1141](https://github.com/go-task/task/issues/1141), [#1144](https://github.com/go-task/task/issues/1144) by [@pd93](https://github.com/pd93)).
|
||||
|
||||
## v3.24.0 - 2023-04-15
|
||||
|
||||
- Fix Fish shell completion for tasks with aliases ([#1113](https://github.com/go-task/task/issues/1113) by [@patricksjackson](https://github.com/patricksjackson)).
|
||||
|
@ -405,6 +405,7 @@ tasks:
|
||||
vars: { TEXT: 'before 1' }
|
||||
- task: echo_sth
|
||||
vars: { TEXT: 'before 2' }
|
||||
silent: true
|
||||
cmds:
|
||||
- echo "after"
|
||||
|
||||
@ -503,7 +504,7 @@ tasks:
|
||||
- echo "Another task"
|
||||
```
|
||||
|
||||
Overriding variables in the called task is as simple as informing `vars` attribute:
|
||||
Using the `vars` and `silent` attributes you can choose to pass variables and toggle [silent mode](#silent-mode) on a call-by-call basis:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -519,6 +520,7 @@ tasks:
|
||||
cmds:
|
||||
- task: greet
|
||||
vars: { RECIPIENT: 'Cruel World' }
|
||||
silent: true
|
||||
```
|
||||
|
||||
The above syntax is also supported in `deps`.
|
||||
|
@ -42,9 +42,5 @@
|
||||
"link.item.label.OpenCollective": {
|
||||
"message": "OpenCollective",
|
||||
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
|
||||
},
|
||||
"link.item.label.Chinese | 中国人": {
|
||||
"message": "Chinês | 中国人",
|
||||
"description": "The label of footer link with label=Chinese | 中国人 linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,5 @@
|
||||
"version.label": {
|
||||
"message": "Next",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.tutorialSidebar.link.Chinese | 中国人": {
|
||||
"message": "Chinese | 中国人",
|
||||
"description": "The label for link Chinese | 中国人 in sidebar tutorialSidebar, linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
@ -272,9 +272,10 @@ tasks:
|
||||
#### Dependency
|
||||
|
||||
| Атрибут | Тип | По умолчанию | Описание |
|
||||
| ------- | ---------------------------------- | ------------ | -------------------------------------------------------- |
|
||||
| -------- | ---------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| `task` | `string` | | The task to be execute as a dependency. |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
|
||||
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
|
||||
|
||||
:::tip
|
||||
|
||||
|
@ -5,6 +5,16 @@ sidebar_position: 8
|
||||
|
||||
# Changelog
|
||||
|
||||
## v3.25.0 - 2023-05-22
|
||||
|
||||
- Support `silent:` when calling another tasks ([#680](https://github.com/go-task/task/issues/680), [#1142](https://github.com/go-task/task/issues/1142) by [@danquah](https://github.com/danquah)).
|
||||
- Improve PowerShell completion script ([#1168](https://github.com/go-task/task/issues/1168) by [@trim21](https://github.com/trim21)).
|
||||
- Add more languages to the website menu and show translation progress percentage ([#1173](https://github.com/go-task/task/issues/1173) by [@misitebao](https://github.com/misitebao)).
|
||||
- Starting on this release, official binaries for FreeBSD will be available to download ([#1068](https://github.com/go-task/task/issues/1068) by [@andreynering](https://github.com/andreynering)).
|
||||
- Fix some errors being unintendedly supressed ([#1134](https://github.com/go-task/task/issues/1134) by [@clintmod](https://github.com/clintmod)).
|
||||
- Fix a nil pointer error when `version` is omitted from a Taskfile ([#1148](https://github.com/go-task/task/issues/1148), [#1149](https://github.com/go-task/task/issues/1149) by [@pd93](https://github.com/pd93)).
|
||||
- Fix duplicate error message when a task does not exists ([#1141](https://github.com/go-task/task/issues/1141), [#1144](https://github.com/go-task/task/issues/1144) by [@pd93](https://github.com/pd93)).
|
||||
|
||||
## v3.24.0 - 2023-04-15
|
||||
|
||||
- Fix Fish shell completion for tasks with aliases ([#1113](https://github.com/go-task/task/issues/1113) by [@patricksjackson](https://github.com/patricksjackson)).
|
||||
|
@ -405,6 +405,7 @@ tasks:
|
||||
vars: { TEXT: 'before 1' }
|
||||
- task: echo_sth
|
||||
vars: { TEXT: 'before 2' }
|
||||
silent: true
|
||||
cmds:
|
||||
- echo "after"
|
||||
|
||||
@ -503,7 +504,7 @@ tasks:
|
||||
- echo "Another task"
|
||||
```
|
||||
|
||||
Переопределение переменных в вызываемой task делается через указание атрибута `vars`:
|
||||
Using the `vars` and `silent` attributes you can choose to pass variables and toggle [silent mode](#silent-mode) on a call-by-call basis:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -519,6 +520,7 @@ tasks:
|
||||
cmds:
|
||||
- task: greet
|
||||
vars: { RECIPIENT: 'Cruel World' }
|
||||
silent: true
|
||||
```
|
||||
|
||||
Указанный выше синтаксис также поддерживается в `deps`.
|
||||
|
@ -42,9 +42,5 @@
|
||||
"link.item.label.OpenCollective": {
|
||||
"message": "OpenCollective",
|
||||
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
|
||||
},
|
||||
"link.item.label.Chinese | 中国人": {
|
||||
"message": "Chinese | 中国人",
|
||||
"description": "The label of footer link with label=Chinese | 中国人 linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,5 @@
|
||||
"version.label": {
|
||||
"message": "Next",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.tutorialSidebar.link.Chinese | 中国人": {
|
||||
"message": "Chinese | 中国人",
|
||||
"description": "The label for link Chinese | 中国人 in sidebar tutorialSidebar, linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
@ -24,31 +24,31 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
|
||||
| 缩写 | 标志 | 类型 | 默认 | 描述 |
|
||||
| ---- | --------------------------- | -------- | -------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| `-c` | `--color` | `bool` | `true` | 彩色输出。 默认开启。 设置为 `false` 或使用 `NO_COLOR=1` 禁用。 |
|
||||
| `-C` | `--concurrency` | `int` | `0` | 限制并发运行的任务数。 零意味着无限。 |
|
||||
| `-C` | `--concurrency` | `int` | `0` | 限制并发运行的 task 数。 零意味着无限。 |
|
||||
| `-d` | `--dir` | `string` | 工作目录 | 设置执行目录。 |
|
||||
| `-n` | `--dry` | `bool` | `false` | 按运行顺序编译和打印任务,而不执行它们。 |
|
||||
| `-x` | `--exit-code` | `bool` | `false` | 传递任务命令的退出代码。 |
|
||||
| `-f` | `--force` | `bool` | `false` | 即使任务是最新的也强制执行。 |
|
||||
| `-g` | `--global` | `bool` | `false` | 从 `$HOME/Taskfile.{yml,yaml}` 运行全局任务文件。 |
|
||||
| `-h` | `--help` | `bool` | `false` | 显示任务使用情况。 |
|
||||
| `-n` | `--dry` | `bool` | `false` | 按运行顺序编译和打印 task,而不执行它们。 |
|
||||
| `-x` | `--exit-code` | `bool` | `false` | 传递 task 命令的退出代码。 |
|
||||
| `-f` | `--force` | `bool` | `false` | 即使 task 是最新的也强制执行。 |
|
||||
| `-g` | `--global` | `bool` | `false` | 从 `$HOME/Taskfile.{yml,yaml}` 运行全局 Taskfile。 |
|
||||
| `-h` | `--help` | `bool` | `false` | 显示 Task 使用情况。 |
|
||||
| `-i` | `--init` | `bool` | `false` | 在当前目录创建一个新的 Taskfile.yml。 |
|
||||
| `-I` | `--interval` | `string` | `5s` | 使用 `--watch` 设置不同的观察间隔,默认为 5 秒。 这个字符串应该是一个有效的 [Go Duration](https://pkg.go.dev/time#ParseDuration)。 |
|
||||
| `-l` | `--list` | `bool` | `false` | 列出当前文件的全部任务及对应描述。 |
|
||||
| `-a` | `--list-all` | `bool` | `false` | 列出无论有没有描述的所有任务。 |
|
||||
| `-l` | `--list` | `bool` | `false` | 列出当前文件的全部 task 及对应描述。 |
|
||||
| `-a` | `--list-all` | `bool` | `false` | 列出无论有没有描述的所有 task。 |
|
||||
| | `--sort` | `string` | `default` | 在列出时更改 task 的顺序。 |
|
||||
| | `--json` | `bool` | `false` | 查看 [JSON 输出](#json-输出) |
|
||||
| `-o` | `--output` | `string` | 在 Taskfile 中设置默认值或 `intervealed` | 设置输出样式:[`interleaved`/`group`/`prefixed`]。 |
|
||||
| | `--output-group-begin` | `string` | | 在任务组输出前打印的消息模板。 |
|
||||
| | `--output-group-end` | `string` | | 在任务组输出后打印的消息模板。 |
|
||||
| | `--output-group-error-only` | `bool` | `false` | 在退出码为 0 时忽略命令输出。 |
|
||||
| `-p` | `--parallel` | `bool` | `false` | 并行执行命令行上提供的任务。 |
|
||||
| `-p` | `--parallel` | `bool` | `false` | 并行执行命令行上提供的 task。 |
|
||||
| `-s` | `--silent` | `bool` | `false` | 禁用回显。 |
|
||||
| | `--status` | `bool` | `false` | 如果任何给定任务不是最新的,则以非 0 退出码退出。 |
|
||||
| | `--summary` | `bool` | `false` | 显示有关任务的摘要。 |
|
||||
| | `--status` | `bool` | `false` | 如果任何给定 task 不是最新的,则以非 0 退出码退出。 |
|
||||
| | `--summary` | `bool` | `false` | 显示有关 task 的摘要。 |
|
||||
| `-t` | `--taskfile` | `string` | `Taskfile.yml` 或 `Taskfile.yaml` | |
|
||||
| `-v` | `--verbose` | `bool` | `false` | 启用详细模式。 |
|
||||
| | `--version` | `bool` | `false` | 显示 Task 版本。 |
|
||||
| `-w` | `--watch` | `bool` | `false` | 启用给定任务的观察器。 |
|
||||
| `-w` | `--watch` | `bool` | `false` | 启用给定 task 的观察器。 |
|
||||
|
||||
## 退出码
|
||||
|
||||
@ -108,14 +108,14 @@ Task 有时会以特定的退出代码退出。 这些代码分为三组,范
|
||||
模板系统上有一些可用的特殊变量:
|
||||
|
||||
| 变量 | 描述 |
|
||||
| ------------------ | --------------------------------------------------------------------- |
|
||||
| ------------------ | ----------------------------------------------------------------------------- |
|
||||
| `CLI_ARGS` | 当通过 CLI 调用 Task 时,传递包含在 `--` 之后的所有额外参数。 |
|
||||
| `TASK` | 当前任务的名称。 |
|
||||
| `TASK` | 当前 task 的名称。 |
|
||||
| `ROOT_DIR` | 根 Taskfile 的绝对路径。 |
|
||||
| `TASKFILE_DIR` | 包含 Taskfile 的绝对路径 |
|
||||
| `USER_WORKING_DIR` | 调用 `task` 的目录的绝对路径。 |
|
||||
| `CHECKSUM` | 在 `sources` 中列出的文件的 checksum。 仅在 `status` 参数中可用,并且如果方法设置为 `checksum`。 |
|
||||
| `TIMESTAMP` | `sources` 中列出的文件的最大时间戳的日期对象。 仅在 `status` 参数中可用,并且如果方法设置为 `timestamp`。 |
|
||||
| `CHECKSUM` | 在 `sources` 中列出的文件的 checksum。 仅在 `status` 参数中可用,并且如果 method 设置为 `checksum`。 |
|
||||
| `TIMESTAMP` | 在 `sources` 中列出的文件的最大时间戳的日期对象。 仅在 `status` 参数中可用,并且如果 method 设置为 `timestamp`。 |
|
||||
| `TASK_VERSION` | Task 的当前版本。 |
|
||||
|
||||
## 环境变量
|
||||
@ -140,12 +140,12 @@ Task 有时会以特定的退出代码退出。 这些代码分为三组,范
|
||||
| ---------- | ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| `version` | `string` | | Taskfile 的版本。 当前版本是 `3`。 |
|
||||
| `output` | `string` | `interleaved` | 输出模式。 可用选项: `interleaved`、`group` 和 `prefixed` |
|
||||
| `method` | `string` | `checksum` | Taskfile 中的默认方法。 可以在任务基础上覆盖。 可用选项:`checksum`、`timestamp` 和 `none`。 |
|
||||
| `method` | `string` | `checksum` | Taskfile 中的默认方法。 可以在 task 基础上覆盖。 可用选项:`checksum`、`timestamp` 和 `none`。 |
|
||||
| `includes` | [`map[string]Include`](#include) | | 要包含的其他 Taskfile。 |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | 一组全局变量。 |
|
||||
| `env` | [`map[string]Variable`](#variable) | | 一组全局环境变量。 |
|
||||
| `tasks` | [`map[string]Task`](#task) | | 一组任务定义。 |
|
||||
| `silent` | `bool` | `false` | 此任务文件的默认“silent”选项。 如果为 `false`,则可以在任务的基础上用 `true` 覆盖。 |
|
||||
| `tasks` | [`map[string]Task`](#task) | | 一组 task 定义。 |
|
||||
| `silent` | `bool` | `false` | 此 Taskfile 的默认“silent”选项。 如果为 `false`,则可以在 task 的基础上用 `true` 覆盖。 |
|
||||
| `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)。 |
|
||||
@ -157,9 +157,9 @@ Task 有时会以特定的退出代码退出。 这些代码分为三组,范
|
||||
| 属性 | 类型 | 默认 | 描述 |
|
||||
| ---------- | --------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `taskfile` | `string` | | 要包含的 Taskfile 或目录的路径。 如果是目录,Task 将在该目录中查找名为 `Taskfile.yml` 或 `Taskfile.yaml` 的文件。 如果是相对路径,则相对于包含 Taskfile 的目录进行解析。 |
|
||||
| `dir` | `string` | Taskfile 文件父目录 | 运行时包含的任务的工作目录。 |
|
||||
| `dir` | `string` | Taskfile 文件父目录 | 运行时包含的 task 的工作目录。 |
|
||||
| `optional` | `bool` | `false` | 设置为 `true` 时, 文件不存在也不会报错 |
|
||||
| `internal` | `bool` | `false` | 停止在命令行上调用包含的任务文件中的任何任务。 当与 `--list` 一起使用时,这些命令也将从输出中省略。 |
|
||||
| `internal` | `bool` | `false` | 停止在命令行上调用包含的 Taskfile 中的任何 task。 当与 `--list` 一起使用时,这些命令也将从输出中省略。 |
|
||||
| `aliases` | `[]string` | | 包含的 Taskfile 的命名空间的替代名称。 |
|
||||
| `vars` | `map[string]Variable` | | 一组应用于包含的 Taskfile 的变量。 |
|
||||
|
||||
@ -197,29 +197,29 @@ vars:
|
||||
### Task
|
||||
|
||||
| 属性 | 类型 | 默认 | 描述 |
|
||||
| --------------- | ---------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
||||
| --------------- | ---------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `cmds` | [`[]Command`](#command) | | 要执行的 shell 命令列表。 |
|
||||
| `deps` | [`[]Dependency`](#dependency) | | 此任务的依赖项列表。 此处定义的任务将在此任务之前并行运行。 |
|
||||
| `label` | `string` | | 运行任务时覆盖输出中的任务名称。 支持变量。 |
|
||||
| `desc` | `string` | | Task 的简短描述。 这在调用 `task --list` 时显示。 |
|
||||
| `summary` | `string` | | 任务的较长描述。 这在调用 `task --summary [task]` 时显示。 |
|
||||
| `aliases` | `[]string` | | 可以调用任务的别名列表。 |
|
||||
| `sources` | `[]string` | | 运行此任务之前要检查的源列表。 与 `checksum` 和 `timestamp` 相关。 可以是文件路径或星号。 |
|
||||
| `generates` | `[]string` | | 此任务要生成的文件列表。 与 `timestamp` 方法相关。 可以是文件路径或星号。 |
|
||||
| `status` | `[]string` | | 用于检查此 task 是否应运行的命令列表。 否则跳过该任务。 这个方法会覆盖 `method`、`sources` 和 `generates`。 |
|
||||
| `preconditions` | [`[]Precondition`](#precondition) | | 用于检查此任务是否应运行的命令列表。 如果不满足条件,任务将出错。 |
|
||||
| `deps` | [`[]Dependency`](#dependency) | | 此 task 的依赖项列表。 此处定义的 task 将在此 task 之前并行运行。 |
|
||||
| `label` | `string` | | 运行 task 时覆盖输出中的 task 名称。 支持变量。 |
|
||||
| `desc` | `string` | | task 的简短描述。 这在调用 `task --list` 时显示。 |
|
||||
| `summary` | `string` | | task 的较长描述。 这在调用 `task --summary [task]` 时显示。 |
|
||||
| `aliases` | `[]string` | | 可以调用 task 的别名列表。 |
|
||||
| `sources` | `[]string` | | 运行此 task 之前要检查的源列表。 与 `checksum` 和 `timestamp` 方法相关。 可以是文件路径或星号。 |
|
||||
| `generates` | `[]string` | | 此 task 要生成的文件列表。 与 `timestamp` 方法相关。 可以是文件路径或星号。 |
|
||||
| `status` | `[]string` | | 用于检查此 task 是否应运行的命令列表。 否则跳过该 task。 这个方法会覆盖 `method`、`sources` 和 `generates`。 |
|
||||
| `preconditions` | [`[]Precondition`](#precondition) | | 用于检查此 task 是否应运行的命令列表。 如果不满足条件,task 将出错。 |
|
||||
| `dir` | `string` | | 此 task 应运行的目录。 默认为当前工作目录。 |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | 可在 task 中使用的一组变量。 |
|
||||
| `env` | [`map[string]Variable`](#variable) | | 一组可用于 shell 命令的环境变量。 |
|
||||
| `dotenv` | `[]string` | | 要解析的 `.env` 文件路径列表。 |
|
||||
| `silent` | `bool` | `false` | 从输出中隐藏任务名称和命令。 命令的输出仍将重定向到 `STDOUT` 和 `STDERR`。 当与 `--list` 标志结合使用时,任务描述将被隐藏。 |
|
||||
| `interactive` | `bool` | `false` | 告诉任务该命令是交互式的。 |
|
||||
| `internal` | `bool` | `false` | 停止在命令行上调用任务。 当与 `--list` 一起使用时,它也会从输出中省略。 |
|
||||
| `method` | `string` | `checksum` | 定义用于检查任务是最新的方法。 `timestamp` 将比较源的时间戳并生成文件。 `checksum` 将检查 checksum(您可能想忽略 .gitignore 文件中的 .task 文件夹)。 `none` 跳过任何验证并始终运行任务。 |
|
||||
| `silent` | `bool` | `false` | 从输出中隐藏 task 名称和命令。 命令的输出仍将重定向到 `STDOUT` 和 `STDERR`。 当与 `--list` 标志结合使用时,task 描述将被隐藏。 |
|
||||
| `interactive` | `bool` | `false` | 告诉 task 该命令是交互式的。 |
|
||||
| `internal` | `bool` | `false` | 停止在命令行上调用 task。 当与 `--list` 一起使用时,它也会从输出中省略。 |
|
||||
| `method` | `string` | `checksum` | 定义用于检查 task 是最新的方法。 `timestamp` 将比较 sources 的时间戳并生成文件。 `checksum` 将检查 checksum(您可能想忽略 .gitignore 文件中的 .task 文件夹)。 `none` 跳过任何验证并始终运行 task。 |
|
||||
| `prefix` | `string` | | 定义一个字符串作为并行运行 task 输出的前缀。 仅在输出模式是 `prefixed` 时使用。 |
|
||||
| `ignore_error` | `bool` | `false` | 如果执行命令时发生错误,则继续执行。 |
|
||||
| `run` | `string` | Taskfile 中全局声明的值或 `always` | 指定如果多次调用该任务是否应再次运行。 可用选项:`always`、`once` 和 `when_changed`。 |
|
||||
| `platforms` | `[]string` | 所有平台 | 指定应在哪些平台上运行任务。 允许使用 [有效的 GOOS 和 GOARCH 值](https://github.com/golang/go/blob/main/src/go/build/syslist.go)。 否则将跳过任务。 |
|
||||
| `run` | `string` | Taskfile 中全局声明的值或 `always` | 指定如果多次调用该 task 是否应再次运行。 可用选项:`always`、`once` 和 `when_changed`。 |
|
||||
| `platforms` | `[]string` | 所有平台 | 指定应在哪些平台上运行 task。 允许使用 [有效的 GOOS 和 GOARCH 值](https://github.com/golang/go/blob/main/src/go/build/syslist.go)。 否则将跳过 task。 |
|
||||
| `set` | `[]string` | | 为 [内置 `set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) 指定选项。 |
|
||||
| `shopt` | `[]string` | | 为 [内置 `shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) 指定选项。 |
|
||||
|
||||
@ -248,9 +248,9 @@ tasks:
|
||||
| `cmd` | `string` | | 要执行的 shell 命令 |
|
||||
| `silent` | `bool` | `false` | 跳过此命令的一些输出。 请注意,命令的 STDOUT 和 STDERR 仍将被重定向。 |
|
||||
| `task` | `string` | | 执行另一个 task,而不执行命令。 不能与 `cmd` 同时设置。 |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | 要传递给引用任务的可选附加变量。 仅在设置 `task` 而不是 `cmd` 时相关。 |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | 要传递给引用 task 的可选附加变量。 仅在设置 `task` 而不是 `cmd` 时相关。 |
|
||||
| `ignore_error` | `bool` | `false` | 执行命令的时候忽略错误,继续执行 |
|
||||
| `defer` | `string` | | `cmd` 的替代方法,但安排命令在此任务结束时执行,而不是立即执行。 不能与 `cmd` 一同使用。 |
|
||||
| `defer` | `string` | | `cmd` 的替代方法,但安排命令在此 task 结束时执行,而不是立即执行。 不能与 `cmd` 一同使用。 |
|
||||
| `platforms` | `[]string` | 所有平台 | 指定应在哪些平台上运行该命令。 允许使用 [有效的 GOOS 和 GOARCH 值](https://github.com/golang/go/blob/main/src/go/build/syslist.go)。 否则将跳过命令。 |
|
||||
| `set` | `[]string` | | 为 [内置 `set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) 指定选项。 |
|
||||
| `shopt` | `[]string` | | 为 [内置 `shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) 指定选项。 |
|
||||
@ -272,9 +272,10 @@ tasks:
|
||||
#### Dependency
|
||||
|
||||
| 属性 | 类型 | 默认 | 描述 |
|
||||
| ------ | ---------------------------------- | -- | --------------- |
|
||||
| `task` | `string` | | 要作为依赖项执行的任务。 |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | 要传递给此任务的可选附加变量。 |
|
||||
| -------- | ---------------------------------- | ------- | --------------------------------------------------- |
|
||||
| `task` | `string` | | 要作为依赖项执行的 task。 |
|
||||
| `vars` | [`map[string]Variable`](#variable) | | 要传递给此 task 的可选附加变量。 |
|
||||
| `silent` | `bool` | `false` | 从输出中隐藏 task 名称和命令。 命令的输出仍将重定向到 `STDOUT` 和 `STDERR`。 |
|
||||
|
||||
:::tip
|
||||
|
||||
@ -291,8 +292,8 @@ tasks:
|
||||
#### Precondition
|
||||
|
||||
| 属性 | 类型 | 默认 | 描述 |
|
||||
| ----- | -------- | -- | ----------------------------------- |
|
||||
| `sh` | `string` | | 要执行的命令。 如果返回非零退出码,任务将在不执行其命令的情况下出错。 |
|
||||
| ----- | -------- | -- | --------------------------------------- |
|
||||
| `sh` | `string` | | 要执行的命令。 如果返回非零退出码, task 将在不执行其命令的情况下出错。 |
|
||||
| `msg` | `string` | | 如果不满足先决条件,则打印可选消息。 |
|
||||
|
||||
:::tip
|
||||
|
@ -5,6 +5,16 @@ sidebar_position: 8
|
||||
|
||||
# 更新日志
|
||||
|
||||
## v3.25.0 - 2023-05-22
|
||||
|
||||
- 调用其他任务时支持 `silent:` (由 [@danquah](https://github.com/danquah) 在 [#680](https://github.com/go-task/task/issues/680)、[#1142](https://github.com/go-task/task/issues/1142) 完成)。
|
||||
- 改进 PowerShell 完成脚本(由 [@trim21](https://github.com/trim21) 在 [#1168](https://github.com/go-task/task/issues/1168) 完成)。
|
||||
- 在网站菜单中添加更多语言并显示翻译进度百分比( by 由 [@misitebao](https://github.com/misitebao) 在 [#1173](https://github.com/go-task/task/issues/1173) 完成)。
|
||||
- 从此版本开始,FreeBSD 的官方二进制文件将可供下载(由 [@andreynering](https://github.com/andreynering) 在 [#1068](https://github.com/go-task/task/issues/1068) 完成)。
|
||||
- 修复一些被意外抑制的错误(由 [@clintmod](https://github.com/clintmod) 在 [#1134](https://github.com/go-task/task/issues/1134) 修复)。
|
||||
- 修复 Taskfile 中省略 `version` 时的 nil 指针错误(由 [@pd93](https://github.com/pd93) 在 [#1148](https://github.com/go-task/task/issues/1148)、[#1149](https://github.com/go-task/task/issues/1149) 修复)。
|
||||
- 修复 task 不存在时的重复错误消息(由 [@pd93](https://github.com/pd93) 在 [#1141](https://github.com/go-task/task/issues/1141)、[#1144](https://github.com/go-task/task/issues/1144) 修复)。
|
||||
|
||||
## v3.24.0 - 2023-04-15
|
||||
|
||||
- 修复带有别名的 task 的 Fish shell 补全 ([#1113](https://github.com/go-task/task/issues/1113) by [@patricksjackson](https://github.com/patricksjackson))。
|
||||
|
@ -9,7 +9,7 @@ sidebar_position: 10
|
||||
|
||||
:::note
|
||||
|
||||
本文档适用于核心 [Task][task] 存储库 _和_ [Task for Visual Studio Code][vscode-task]。
|
||||
本文档适用于 [Task][task] 核心存储库 _和_ [Task for Visual Studio Code][vscode-task]。
|
||||
|
||||
:::
|
||||
|
||||
@ -55,7 +55,7 @@ Task 使用 [Docusaurus][docusaurus] 来托管文档服务器。 此代码位于
|
||||
|
||||
## 3. 提交代码
|
||||
|
||||
尝试编写有意义的提交消息并避免在 PR 上有太多提交。 大多数 PR 应该有一个单一的提交(尽管对于更大的 PR 将它分成几个可能是合理的)。 Git squash(并和) 和 rebase(变基) 是你的好朋友!
|
||||
尝试编写有意义的提交消息并避免在 PR 上有太多提交。 大多数 PR 应该有一个单一的提交(尽管对于更大的 PR 将它分成几个可能是合理的)。 Git squash(并和) 和 rebase(变基) 是你的好伙伴!
|
||||
|
||||
如果您不确定如何格式化提交消息,请查看 [约定式提交][conventional-commits]。 这种风格不是强制的,但它是使您的提交消息更具可读性和一致性的好方法。
|
||||
|
||||
|
@ -12,7 +12,7 @@ sidebar_position: 6
|
||||
|
||||
## 为什么我的 task 不会更新我的 shell 环境?
|
||||
|
||||
这是 shell 工作方式的限制。 任务作为当前 shell 的子进程运行,因此它不能更改启动它的 shell 的环境。 其他任务运行器和构建工具也有此限制。
|
||||
这是 shell 工作方式的限制。 Task 作为当前 shell 的子进程运行,因此它不能更改启动它的 shell 的环境。 其他任务运行器和构建工具也有此限制。
|
||||
|
||||
解决此问题的一种常见方法是创建一个 task,该任务将生成可由您的 shell 解析的输出。 例如,要在 shell 上设置环境变量,您可以编写如下任务:
|
||||
|
||||
|
@ -28,14 +28,14 @@ tasks:
|
||||
|
||||
然后通过从您的终端运行 `task hello` 来调用它。
|
||||
|
||||
上面的示例只是一个开始,您可以查看 [使用指南](/usage) 以检查完整的模式文档和任务功能。
|
||||
上面的示例只是一个开始,您可以查看 [使用指南](/usage) 以检查完整的规则文档和 Task 功能。
|
||||
|
||||
## 特性
|
||||
|
||||
- [易于安装](installation.md):只需要下载一个二进制文件,添加到 `$PATH` 即可! 或者,您也可以根据需要使用 [Homebrew](https://brew.sh/)、[Snapcraft](https://snapcraft.io/) 或 [Scoop](https://scoop.sh/) 进行安装。
|
||||
- 可以在 CI 中使用:只要添加 [这个命令](installation.md#安装脚本) 到 CI 安装脚本中,然后就可以把 Task 当做 CI 的一个功能来使用了。
|
||||
- 真正的跨平台:虽然大多数构建工具只能在 Linux 或 macOS 上运行良好,但由于 [这个用于 Go 的 shell 解释器](https://github.com/mvdan/sh),Task 也支持 Windows。
|
||||
- 非常适合代码生成:如果给定的一组文件自上次运行以来没有更改(基于其时间戳或内容),您可以轻松地 [阻止任务运行](/usage#减少不必要的工作)。
|
||||
- 非常适合代码生成:如果给定的一组文件自上次运行以来没有更改(基于其时间戳或内容),您可以轻松地 [阻止 task 运行](/usage#减少不必要的工作)。
|
||||
|
||||
## 金牌赞助商
|
||||
|
||||
|
@ -201,7 +201,7 @@ tasks:
|
||||
- 环境变量
|
||||
- 全局或 CLI 变量
|
||||
- 调用变量
|
||||
- Task 内的变量
|
||||
- Task 变量
|
||||
|
||||
[output]: usage.md#输出语法
|
||||
[ignore_errors]: usage.md#忽略错误
|
||||
|
@ -405,6 +405,7 @@ tasks:
|
||||
vars: { TEXT: 'before 1' }
|
||||
- task: echo_sth
|
||||
vars: { TEXT: 'before 2' }
|
||||
silent: true
|
||||
cmds:
|
||||
- echo "after"
|
||||
|
||||
@ -503,7 +504,7 @@ tasks:
|
||||
- echo "Another task"
|
||||
```
|
||||
|
||||
在被调用 task 中覆盖变量就像通知 `vars` 属性一样简单:
|
||||
使用 `vars` 和 `silent` 属性,您可以选择在逐个调用的基础上传递变量和切换 [静默模式](#静默模式):
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -519,6 +520,7 @@ tasks:
|
||||
cmds:
|
||||
- task: greet
|
||||
vars: { RECIPIENT: 'Cruel World' }
|
||||
silent: true
|
||||
```
|
||||
|
||||
`deps` 也支持上述语法。
|
||||
|
@ -42,9 +42,5 @@
|
||||
"link.item.label.OpenCollective": {
|
||||
"message": "OpenCollective",
|
||||
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
|
||||
},
|
||||
"link.item.label.Chinese | 中国人": {
|
||||
"message": "Chinese | 中国人",
|
||||
"description": "The label of footer link with label=Chinese | 中国人 linking to https://task-zh.readthedocs.io/zh_CN/latest/"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user