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,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!")

View file

@ -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
)