mirror of
https://github.com/go-task/task.git
synced 2026-02-24 12:10:47 +01:00
docs(requires): add shell command example for enum ref
This commit is contained in:
@@ -1278,6 +1278,26 @@ tasks:
|
||||
- echo "Deploying to {{.ENV}}"
|
||||
```
|
||||
|
||||
Or generate values dynamically from a shell command:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
AVAILABLE_SERVICES:
|
||||
sh: ls services/
|
||||
|
||||
tasks:
|
||||
deploy:
|
||||
requires:
|
||||
vars:
|
||||
- name: SERVICE
|
||||
enum:
|
||||
ref: .AVAILABLE_SERVICES | splitLines | compact
|
||||
cmds:
|
||||
- echo "Deploying {{.SERVICE}}"
|
||||
```
|
||||
|
||||
### Prompting for missing variables interactively
|
||||
|
||||
If you want Task to prompt users for missing required variables instead of
|
||||
|
||||
Reference in New Issue
Block a user