You can install cynew by the way you prefer.
- Download cynew
- Add cynew into environment variable PATH
export PATH=$PATH:[folder where you install cynew]You need install Golang first
- Clone the repo
go get github.com/yah01/cynew- Change directory to where cynew exists
cd $GOPATH/src/github.com/yah01/cynew- Run build command
go build- There will be a executable file
- Add cynew into environment variable PATH
export PATH=$PATH:[folder where you install cynew]cynew hello.cppcynew first.go second.jsonExamples above are simple and nothing awesome, they can't show power of cynew. You may want to create a file/folder with some contents (what I call template), you can indicate a template when you create file/folder, cynew will write the contents what the template saving into the file/folder.
Maybe you are building a awesome project, and many source code file have some common contents (template my-template):
cynew awesome.go -t my-templateYou can create more than one file by just adding more file names
Maybe you used scaffold what creates a folder with some contents (files,folders,... I would call also it template), cynew is a scaffold creator and builder!
cynew my-app -t my-awesome-project
command above will create a folder with name my-app, and fill it with contents what template my-awesome-project saving.
Now you know how to create file/folder with template, but where is the template? You can create template with cynew easily
cynew -a hello.goThis will create a template with content what hello.go has, then cynew will ask you to input a template name (if you input nothing, the template name is the file name). You can create a folder template by the same way.
- [-h]: show help information
- [-ls]: list all template(s)
- [-t template]: create file/folder with template
- [-a filename]: add filename into templates (folder is OK)
- [-d template]: delete template
- [-i template]: show information of template