pimp template system is based on Go template systemarrow-up-right. There are no fundamental differences between them. The following piece of code behaves as you would expect:
{{- /* template.tmpl */ -}} Git branches in {{pwd}}: {{- range GitBranches}} * {{.}} {{- end}}
Note the use of the GitBranches function. Refer to the template functions documentation to learn more about all the functions available.
GitBranches
You can use pimp --eval 'funcs | toPrettyJSON' to list all the functions available when rendering a template.
pimp --eval 'funcs | toPrettyJSON'
Read more about the Template Engine in the documentation.
Next, let's see how you can run scripts with Pimp.
Last updated 4 years ago