├── .gitignore ├── LICENSE ├── README.md ├── RELEASE-NOTES.md ├── g8 ├── cmd_new.go ├── cmd_scaffold.go ├── flags.go ├── main.go ├── main_test.go └── utils.go ├── git ├── clone.go └── git.go ├── go.mod ├── go.sum ├── release.sh └── template ├── compat.go ├── compat_test.go ├── functions.go ├── functions_test.go ├── template.go └── template_test.go /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore binary 2 | /g8/g8 3 | .DS_Store 4 | /.idea/ 5 | /.vscode/ 6 | /vendor/ 7 | /temp/ 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Matt Ho 4 | Copyright (c) 2019-2020 Thanh Nguyen 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # go-giter8 2 | 3 | `btnguyen2k/go-giter8` is a fork of [`savaki/go-giter8`](https://github.com/savaki/go-giter8), 4 | which is a command line tool to generate files and directories from templates published on git repository. 5 | It's implemented in Go and can produce output for any purpose. 6 | 7 | Features: 8 | - [x] Generate template output from any git repository. 9 | - [x] Generate template outout from a specific git branch or tag. 10 | - [x] Generate template output from local directory (protocol `file://`). 11 | - [x] Support scaffolding. 12 | 13 | Latest version: [v0.6.0](RELEASE-NOTES.md). 14 | 15 | ## Installation 16 | 17 | > `go-giter8` is go-module enabled. Therefore, it must be installed/upgraded in go-module mode by setting `GO111MODULE=on`. 18 | 19 | You can install `go-giter8` using the standard go deployment tool. This will install g8 as ```$GOPATH/bin/g8```: 20 | 21 | ``` 22 | export GO111MODULE=on && go get github.com/btnguyen2k/go-giter8/g8 23 | ``` 24 | 25 | or you can specified a specific version: 26 | 27 | ``` 28 | export GO111MODULE=on && go get github.com/btnguyen2k/go-giter8/g8@v0.6.0 29 | ``` 30 | 31 | ### Upgrading 32 | 33 | At any point you can upgrade `g8` using the following: 34 | 35 | ``` 36 | export GO111MODULE=on && go get -u github.com/btnguyen2k/go-giter8/g8 37 | ``` 38 | 39 | or you can specified a specific version: 40 | 41 | ``` 42 | export GO111MODULE=on && go get -u github.com/btnguyen2k/go-giter8/g8@v0.6.0 43 | ``` 44 | 45 | ## Giter8 template 46 | 47 | For information on Giter8 templates, please see [http://www.foundweekends.org/giter8/](http://www.foundweekends.org/giter8/). 48 | 49 | Summary of a Giter8 template project structure: 50 | 51 | ``` 52 | / 53 | └── src/main/ 54 | ├── g8/ 55 | │ └──