Enhance dev runner with automatic service builds

This commit is contained in:
Ilya Groshev
2026-04-22 21:47:51 +03:00
parent 056537998a
commit 945ca2e3df
4 changed files with 98 additions and 5 deletions
+15 -1
View File
@@ -795,7 +795,21 @@ func saveConfig(cfg config) {
}
func launchDev(ip string, p ports) {
cmd := exec.Command("go", "run", "./cmd/dev",
ext := ""
if runtime.GOOS == "windows" {
ext = ".exe"
}
devBin := filepath.Join("bin", "dev"+ext)
_ = spinner.New().Title(" Building services...").Action(func() {
if err := os.MkdirAll("bin", 0755); err != nil {
fmt.Fprintf(os.Stderr, " Failed to create bin/: %v\n", err)
os.Exit(1)
}
runQuiet(exec.Command("go", "build", "-o", devBin, "./cmd/dev"), "build dev")
}).Run()
cmd := exec.Command(devBin,
"--grpc.listen", fmt.Sprintf("0.0.0.0:%d", p.GRPC),
"--grpc.public-addr", fmt.Sprintf("%s:%d", ip, p.GRPC),
"--cdn.listen", fmt.Sprintf("0.0.0.0:%d", p.CDN),