vgo - add command working

This commit is contained in:
jharshman 2019-01-30 01:44:39 -08:00 committed by Steve Francia
parent 3c42f846c2
commit 2fea75b02e
2 changed files with 4 additions and 3 deletions

View file

@ -98,10 +98,11 @@ func (c *Command) Create() error {
defer cmdFile.Close() defer cmdFile.Close()
commandTemplate := template.Must(template.New("sub").Parse(string(tpl.AddCommandTemplate()))) 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 { if err != nil {
return err return err
} }
return nil
} }
// NewProject returns Project with specified project name. // NewProject returns Project with specified project name.

View file

@ -110,8 +110,8 @@ func initConfig() {
func AddCommandTemplate() []byte { func AddCommandTemplate() []byte {
return []byte(`/* return []byte(`/*
{{ .Copyright }} {{ .Project.Copyright }}
{{ if .Legal.Header }}{{ .Legal.Header }}{{ end }} {{ if .Project.Legal.Header }}{{ .Project.Legal.Header }}{{ end }}
*/ */
package cmd package cmd