Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbmina committed Oct 16, 2024
1 parent e870378 commit a1a943b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion website/docs/reference/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ vars:
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
| `prompt` | `string` | | A prompt that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks. |
| `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. |
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
| `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. |
Expand Down
18 changes: 18 additions & 0 deletions website/docs/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,24 @@ tasks:
task: "This is a dangerous command... Do you want to continue?" [y/N]
```

Prompts can be a single value or a list of prompts, like below:

```yaml
version: '3'
tasks:
example:
cmds:
- task: dangerous
dangerous:
prompt:
- This is a dangerous command... Do you want to continue?
- Are you sure?
cmds:
- echo 'dangerous command'
```

Warning prompts are called before executing a task. If a prompt is denied Task
will exit with [exit code](/api#exit-codes) 205. If approved, Task will continue
as normal.
Expand Down
7 changes: 5 additions & 2 deletions website/static/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@
"type": "string"
},
"prompt": {
"description": "A prompt that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks.",
"type": "string"
"description": "One or more prompts that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks.",
"type": "array",
"items": {
"type": "string"
}
},
"summary": {
"description": "A longer description of the task. This is displayed when calling `task --summary [task]`.",
Expand Down

0 comments on commit a1a943b

Please sign in to comment.