agent/cmd/core-agent/update.go
Virgil 364007d424 fix(ax): add missing examples and helper coverage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 21:44:22 +00:00

27 lines
767 B
Go

// SPDX-License-Identifier: EUPL-1.2
package main
// version is set at build time via ldflags:
//
// go build -ldflags "-X 'dappco.re/go/agent.version=0.15.0'" ./cmd/core-agent/
var version string
// updateChannel maps the build version to the release channel.
//
// version = "0.15.0"
// updateChannel() // "stable"
func updateChannel() string {
switch {
case version == "" || version == "dev":
return "dev"
case len(version) > 0 && (version[len(version)-1] >= 'a'):
return "prerelease"
default:
return "stable"
}
}
// TODO: wire go-update UpdateService for self-update command
// Channels: stable → GitHub releases, prerelease → GitHub dev, dev → Forge main
// Parked until version var moves to module root package (dappco.re/go/agent.Version)