gen-files

command module
v0.0.0-...-b8a73c1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

README

gen-files

code generator that uses template files to create a code skeleton

install

if you have go installed:

$ go get -u -v github.com/advincze/gen-files

you'll find gen-files in $GOPATH/bin/gen-files

use
$ gen-files

Usage of gen-files:
  -config string
    	config file (required)
  -index string
    	index file (required)
  -to string
    	target dir (required)

the config file is a generic JSON file where you can store arbitratry configuration for

{
	"foo":"bar"
}

the index file contains the files to create:

{
  "files": [
    {
      "from": "foo/Hello.java",
      "to": "{{ .foo }}/World.java"
    },
    {
      "from": "foo/Hello.java",
      "to": "{{ .foo }}2/World.java"
    },
    { ...

the template files and the names of the "to" paths can use go template syntax:

https://golang.org/pkg/text/template/

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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