docs(requires): add shell command example for enum ref

This commit is contained in:
Valentin Maerten
2026-02-04 22:57:11 +01:00
parent 0354bfdb57
commit adc45c87db

View File

@@ -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