From e9493a400017d2776b6d27eee545ace7f323afc9 Mon Sep 17 00:00:00 2001 From: maddalax Date: Fri, 13 Sep 2024 20:11:32 -0500 Subject: [PATCH] make download template up the deps --- framework/tooling/downloadtemplate/main.go | 33 ++++++++++------------ starter-template/go.mod | 2 +- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/framework/tooling/downloadtemplate/main.go b/framework/tooling/downloadtemplate/main.go index 67cc292..8b68641 100644 --- a/framework/tooling/downloadtemplate/main.go +++ b/framework/tooling/downloadtemplate/main.go @@ -66,26 +66,23 @@ func main() { newDir := filepath.Join(cwd, *outPath) - mvCmd := exec.Command("cp", "-vaR", fmt.Sprintf("%s/.", excludeDir), ".") - mvCmd.Dir = newDir - mvCmd.Stdout = os.DevNull - mvCmd.Stderr = os.DevNull - err = mvCmd.Run() - - if err != nil { - println("Error moving files %v\n", err) - return + commands := [][]string{ + {"cp", "-vaR", fmt.Sprintf("%s/.", excludeDir), "."}, + {"rm", "-rf", excludeDir}, + {"go", "get", "github.com/maddalax/htmgo/framework"}, + {"go", "get", "github.com/maddalax/htmgo/framework-ui"}, } - rmCmd := exec.Command("rm", "-rf", "starter-template") - rmCmd.Dir = newDir - mvCmd.Stdout = os.DevNull - mvCmd.Stderr = os.DevNull - err = rmCmd.Run() - - if err != nil { - println("Error removing starter-template %v\n", err) - return + for _, command := range commands { + cmd := exec.Command(command[0], command[1:]...) + cmd.Dir = newDir + cmd.Stdout = nil + cmd.Stderr = nil + err = cmd.Run() + if err != nil { + println("Error executing command %s\n", err.Error()) + return + } } println("Template downloaded successfully!") diff --git a/starter-template/go.mod b/starter-template/go.mod index f481a66..0159586 100644 --- a/starter-template/go.mod +++ b/starter-template/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/gofiber/fiber/v2 v2.52.5 github.com/google/uuid v1.6.0 - github.com/maddalax/htmgo/framework v0.0.0-20240914003619-c256552b2143 + github.com/maddalax/htmgo/framework v0.0.0-20240914010415-2397bf9fb057 github.com/maddalax/htmgo/framework-ui v0.0.0-20240914003619-c256552b2143 github.com/redis/go-redis/v9 v9.6.1 )