forked from mirror/cobra
vgo - add command working
This commit is contained in:
parent
3c42f846c2
commit
2fea75b02e
|
@ -98,10 +98,11 @@ func (c *Command) Create() error {
|
|||
defer cmdFile.Close()
|
||||
|
||||
commandTemplate := template.Must(template.New("sub").Parse(string(tpl.AddCommandTemplate())))
|
||||
err = commandTemplate.Execute(cmdFile, c.Project.AbsolutePath)
|
||||
err = commandTemplate.Execute(cmdFile, c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewProject returns Project with specified project name.
|
||||
|
|
|
@ -110,8 +110,8 @@ func initConfig() {
|
|||
|
||||
func AddCommandTemplate() []byte {
|
||||
return []byte(`/*
|
||||
{{ .Copyright }}
|
||||
{{ if .Legal.Header }}{{ .Legal.Header }}{{ end }}
|
||||
{{ .Project.Copyright }}
|
||||
{{ if .Project.Legal.Header }}{{ .Project.Legal.Header }}{{ end }}
|
||||
*/
|
||||
package cmd
|
||||
|
||||
|
|
Loading…
Reference in New Issue