
gotmpl
Description
gotmpl is a super simple command line program for rendering templates. gotmpl uses environment variables as its context and go-adaptive-functions for its functions.
Installation
No installation is required. Just grab a release. You might want to rename your binary to just gotmpl for convenience.
If you do have go already installed, you can just run using go run main.go or install with bash scripts/install.sh
Usage
See the few examples below.
Note: Since Go templates add the piped value to the end of the positional argument array, gotmpl reorders the piped value to the beginning of the argument array, so go-adaptive-functions can be used. This leads to a more seamless pattern, particularly for functions such as split, join, etc.
Examples
Get Shell
echo '{{ split .SHELL "/" | last }}' | go run main.go
Clean Path
echo '{{ .PATH | split ":" | set | array | sort | join ":" }}' | go run main.go
Contributing
Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.md for how to get started.
License
This work is distributed under the MIT License. See LICENSE file.