make download template up the deps

This commit is contained in:
maddalax 2024-09-13 20:11:32 -05:00
parent 2397bf9fb0
commit e9493a4000
2 changed files with 16 additions and 19 deletions

View file

@ -66,27 +66,24 @@ func main() {
newDir := filepath.Join(cwd, *outPath) newDir := filepath.Join(cwd, *outPath)
mvCmd := exec.Command("cp", "-vaR", fmt.Sprintf("%s/.", excludeDir), ".") commands := [][]string{
mvCmd.Dir = newDir {"cp", "-vaR", fmt.Sprintf("%s/.", excludeDir), "."},
mvCmd.Stdout = os.DevNull {"rm", "-rf", excludeDir},
mvCmd.Stderr = os.DevNull {"go", "get", "github.com/maddalax/htmgo/framework"},
err = mvCmd.Run() {"go", "get", "github.com/maddalax/htmgo/framework-ui"},
if err != nil {
println("Error moving files %v\n", err)
return
} }
rmCmd := exec.Command("rm", "-rf", "starter-template") for _, command := range commands {
rmCmd.Dir = newDir cmd := exec.Command(command[0], command[1:]...)
mvCmd.Stdout = os.DevNull cmd.Dir = newDir
mvCmd.Stderr = os.DevNull cmd.Stdout = nil
err = rmCmd.Run() cmd.Stderr = nil
err = cmd.Run()
if err != nil { if err != nil {
println("Error removing starter-template %v\n", err) println("Error executing command %s\n", err.Error())
return return
} }
}
println("Template downloaded successfully!") println("Template downloaded successfully!")
} }

View file

@ -5,7 +5,7 @@ go 1.23.0
require ( require (
github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/fiber/v2 v2.52.5
github.com/google/uuid v1.6.0 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/maddalax/htmgo/framework-ui v0.0.0-20240914003619-c256552b2143
github.com/redis/go-redis/v9 v9.6.1 github.com/redis/go-redis/v9 v9.6.1
) )