https://github.com/advincze/gen-files
https://github.com/advincze/gen-files
codegenerator golang template
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/advincze/gen-files
- Owner: advincze
- License: apache-2.0
- Created: 2017-02-21T11:10:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T15:31:48.000Z (over 9 years ago)
- Last Synced: 2024-06-20T12:46:07.963Z (almost 2 years ago)
- Topics: codegenerator, golang, template
- Language: Go
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gen-files
=========
code generator that uses template files to create a code skeleton
### install
if you have [go](golang.org/dl) 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/