Closed anthonychung14 closed 3 months ago
I don't think this is explicitly supported, I think this would work if you did something like this?
inject:
- name: "add role to site.yaml"
path: site.yaml
at: "# $Scaffold.role_name"
template: {{ if .Scaffold.some_value }} whatever thing you want {{ end }}
If that doesn't work, I can add this so that when the template evaluates to empty or whitespace we can ignore the inject.
ahh I see the light. I was originally looking into go generate
for my use case, but it looks like this is powered by the text/template
. docs are clear on how to do the thing. thank you!
I'd like to run an injection only if an input resolves to true. is there a way I can do this now?