Skip to content

Commit a1a943b

Browse files
committed
update docs
1 parent e870378 commit a1a943b

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

website/docs/reference/schema.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ vars:
8888
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
8989
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
9090
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
91-
| `prompt` | `string` | | A prompt that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks. |
91+
| `prompt` | `[]string` | | One or more prompts that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks. |
9292
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
9393
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
9494
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |

website/docs/usage.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,24 @@ tasks:
18441844
task: "This is a dangerous command... Do you want to continue?" [y/N]
18451845
```
18461846

1847+
Prompts can be a single value or a list of prompts, like below:
1848+
1849+
```yaml
1850+
version: '3'
1851+
1852+
tasks:
1853+
example:
1854+
cmds:
1855+
- task: dangerous
1856+
1857+
dangerous:
1858+
prompt:
1859+
- This is a dangerous command... Do you want to continue?
1860+
- Are you sure?
1861+
cmds:
1862+
- echo 'dangerous command'
1863+
```
1864+
18471865
Warning prompts are called before executing a task. If a prompt is denied Task
18481866
will exit with [exit code](/api#exit-codes) 205. If approved, Task will continue
18491867
as normal.

website/static/schema.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@
5959
"type": "string"
6060
},
6161
"prompt": {
62-
"description": "A prompt that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks.",
63-
"type": "string"
62+
"description": "One or more prompts that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks.",
63+
"type": "array",
64+
"items": {
65+
"type": "string"
66+
}
6467
},
6568
"summary": {
6669
"description": "A longer description of the task. This is displayed when calling `task --summary [task]`.",

0 commit comments

Comments
 (0)