diff --git a/cobra/cmd/project.go b/cobra/cmd/project.go index 3f7a4c8f..9f8dba90 100644 --- a/cobra/cmd/project.go +++ b/cobra/cmd/project.go @@ -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. diff --git a/cobra/tpl/main.go b/cobra/tpl/main.go index ba4d7cc5..71f1f450 100644 --- a/cobra/tpl/main.go +++ b/cobra/tpl/main.go @@ -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