fix: conditional client build

This commit is contained in:
2025-03-18 17:41:29 -04:00
parent 21cd91156c
commit 86b74e0ebc
2 changed files with 12 additions and 4 deletions

View File

@ -1,16 +1,24 @@
// go:build !dev
//go:build !dev
package client
import (
"embed"
"io/fs"
"log"
"net/http"
)
//go:embed client
//go:embed all:client
var eclient embed.FS
func init() {
fs := http.FS(eclient)
log.Println("Initializing client for production")
client, err := fs.Sub(eclient, "client")
if err != nil {
log.Fatalf("failed to get client: %v", err)
}
fs := http.FS(client)
embedfs = &fs
}