crain

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

README


Project construction from opinionated templates.

Build Status GoDev License codecov Release

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

FOSSA Status

TODOs

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL