File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cmd
33import (
44 "fmt"
55 "github.com/commitdev/commit0/templator"
6+ "github.com/gobuffalo/packr/v2"
67 "github.com/spf13/cobra"
78 "os"
89)
@@ -17,8 +18,13 @@ var rootCmd = &cobra.Command{
1718 },
1819}
1920
20- func Execute (templates * templator.Templator ) {
21- Templator = templates
21+ func Init () {
22+ templates := packr .New ("templates" , "../templates" )
23+ Templator = templator .NewTemplator (templates )
24+ }
25+
26+ func Execute () {
27+ Init ()
2228 if err := rootCmd .Execute (); err != nil {
2329 fmt .Println (err )
2430 os .Exit (1 )
Original file line number Diff line number Diff line change @@ -2,12 +2,8 @@ package main
22
33import (
44 "github.com/commitdev/commit0/cmd"
5- "github.com/commitdev/commit0/templator"
6- "github.com/gobuffalo/packr/v2"
75)
86
97func main () {
10- templates := packr .New ("templates" , "./templates" )
11- templator := templator .NewTemplator (templates )
12- cmd .Execute (templator )
8+ cmd .Execute ()
139}
You can’t perform that action at this time.
0 commit comments