omio-labs / myke

make with yaml: development tasks made simple with golang, yaml and many ingredients
https://omio-labs.github.io/myke
MIT License
70 stars 16 forks source link

Be more explicit about missing required variable #115

Open licarth opened 5 years ago

licarth commented 5 years ago

Output the name of missing required variable(s) when they're missing, instead of just "error calling required: variable not provided to template".

---
project: test-project

tasks:
  test-task:
    cmd: echo {{.MISSING_VARIABLE}}
$ m test-task
• test-project/test-task: Running
• test-project/test-task: Failed, Took: 901.515µs
⨯ error                     error=error running command: test-project/test-task: template: test:1:25: executing "test" at <required>: error calling required: variable not provided to template

I'll see if I've got some time for that this week, but feel free to take it if you want.