mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
vgo - add command working
This commit is contained in:
parent
3c42f846c2
commit
2fea75b02e
2 changed files with 4 additions and 3 deletions
|
@ -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 a new issue