chore: build.sh con version desde app.md + pre-commit anti-stale
build.sh inyecta la version de app.md por -ldflags (-X main.version), haciendo de app.md la unica fuente de verdad — el binario ya no puede quedar por detras (drift 0.7.0 vs 0.8.0 del 16/06/2026). main.go pasa la version de const a var para permitir el override por ldflags. scripts/pre-commit recompila en cada commit para que el binario que sirve el .mcp.json nunca quede stale respecto a los .go commiteados (la causa raiz del mismo bug). scripts/install-hooks.sh lo instala via symlink.
This commit is contained in:
@@ -15,7 +15,11 @@ import (
|
||||
"fn-registry/functions/browser"
|
||||
)
|
||||
|
||||
const version = "0.8.0"
|
||||
// version is the server version reported in serverInfo. The literal here is a
|
||||
// fallback for `go build` with no flags; build.sh overrides it via
|
||||
// -ldflags "-X main.version=<app.md version>" so app.md stays the single source
|
||||
// of truth and the binary can never drift behind it (see build.sh).
|
||||
var version = "0.8.0"
|
||||
|
||||
type config struct {
|
||||
httpAddr string
|
||||
|
||||
Reference in New Issue
Block a user