Overview
crain provides a way to construct projects from opinionated, composable templates.
My goal with this project, specifically with the templates is to "document"
the opinions that I have in the form of templates that can be shared and used by
others or minimally, referenced in code reviews. While these opinions are my own,
they have absolutely been influenced by the work of others.
Installing
(
d=$(mktemp -d) cd $d
go get -u -v github.com/mccurdyc/crain
go install github.com/mccurdyc/crain
)
Usage
% crain project -h
USAGE
project <subcommand>
SUBCOMMANDS
generate Generates a new project.
FLAGS
-config config.toml A config file defining values for the required variables for all templates used.
-destination . The destination directory where the project should be created.
-templates glue A comma-separate list of template names.
-templates-path ./_tmpls Path to templates.
Contributing
License

TODOs
Handle crain with missing subcommands.
GitHub Action for CI (build and test).
Backport changes to crain to the template files.
- Copy the contents of the template directory, but not the directory itself.
- Refactor / cleanup the tests in
exec_test.go. There is a lot of duplicated logic and lack of table-testing.
version subcommand for crain and accompanying template.
- When copying a template, don't copy the
variables.hcl file.
- Parse and check the supplied variables against the
variables.hcl file in templates.
- Simplify each template so that they are more composable and align with the Unix philosophy of doing one thing.
- Render templated filenames.
- Configurable template delimeters.
- Move templates to a separate GitHub repository.
- Generate README usage section via Make target or something.