diff options
Diffstat (limited to 'cmd/ponzu/generate.go')
-rw-r--r-- | cmd/ponzu/generate.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd/ponzu/generate.go b/cmd/ponzu/generate.go index 9325d1d..c2c4237 100644 --- a/cmd/ponzu/generate.go +++ b/cmd/ponzu/generate.go @@ -132,7 +132,7 @@ func isHyphen(char rune) bool { return char == '-' } -func generateContentType(args []string, path string) error { +func generateContentType(args []string) error { name := args[0] fileName := strings.ToLower(name) + ".go" @@ -143,10 +143,6 @@ func generateContentType(args []string, path string) error { return err } - if path != "" { - pwd = path - } - contentDir := filepath.Join(pwd, "content") filePath := filepath.Join(contentDir, fileName) @@ -167,7 +163,8 @@ func generateContentType(args []string, path string) error { return fmt.Errorf("Failed to parse type args: %s", err.Error()) } - tmpl, err := template.ParseFiles("contentType.tmpl") + tmplPath := filepath.Join(pwd, "cmd", "ponzu", "contentType.tmpl") + tmpl, err := template.ParseFiles(tmplPath) if err != nil { return fmt.Errorf("Failed to parse template: %s", err.Error()) } |