From d555e5337ffce56bd600d938f19cb68ff55d058a Mon Sep 17 00:00:00 2001 From: maddalax Date: Fri, 24 Jan 2025 11:51:01 -0600 Subject: [PATCH] make run server build the binary instead of outputting each run to a tmp file ensure tailwind cli is v3 for now --- cli/htmgo/runner.go | 2 +- cli/htmgo/tasks/css/css.go | 2 +- cli/htmgo/tasks/run/build.go | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cli/htmgo/runner.go b/cli/htmgo/runner.go index 2b8a7e0..eae3e4f 100644 --- a/cli/htmgo/runner.go +++ b/cli/htmgo/runner.go @@ -18,7 +18,7 @@ import ( "strings" ) -const version = "1.0.5" +const version = "1.0.6" func main() { needsSignals := true diff --git a/cli/htmgo/tasks/css/css.go b/cli/htmgo/tasks/css/css.go index 1c07ec2..5f35c69 100644 --- a/cli/htmgo/tasks/css/css.go +++ b/cli/htmgo/tasks/css/css.go @@ -78,7 +78,7 @@ func downloadTailwindCli() { log.Fatal(fmt.Sprintf("Unsupported OS/ARCH: %s/%s", os, arch)) } fileName := fmt.Sprintf(`tailwindcss-%s`, distro) - url := fmt.Sprintf(`https://github.com/tailwindlabs/tailwindcss/releases/latest/download/%s`, fileName) + url := fmt.Sprintf(`https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.16/%s`, fileName) cmd := fmt.Sprintf(`curl -LO %s`, url) process.Run(process.NewRawCommand("tailwind-cli-download", cmd, process.ExitOnError)) diff --git a/cli/htmgo/tasks/run/build.go b/cli/htmgo/tasks/run/build.go index 2f2f10b..39c4773 100644 --- a/cli/htmgo/tasks/run/build.go +++ b/cli/htmgo/tasks/run/build.go @@ -18,7 +18,14 @@ func MakeBuildable() { func Build() { MakeBuildable() - process.RunOrExit(process.NewRawCommand("", "mkdir -p ./dist")) + _ = os.RemoveAll("./dist") + + err := os.Mkdir("./dist", 0755) + + if err != nil { + fmt.Println("Error creating dist directory", err) + os.Exit(1) + } if os.Getenv("SKIP_GO_BUILD") != "1" { process.RunOrExit(process.NewRawCommand("", fmt.Sprintf("go build -tags prod -o ./dist")))