CFG_VER is always a concrete version: dev builds stamp v0.0.0, never "dev"
This commit is contained in:
@@ -59,8 +59,15 @@ func sampleEntries(logFile string) []sampleEntry {
|
||||
// (a Windows service has no console). CFG_VER records the version that
|
||||
// wrote the file so later installs can upgrade it.
|
||||
func SampleEnv(version, logFile string) string {
|
||||
// CFG_VER is always a concrete vX.Y.Z — never "dev". A dev build
|
||||
// stamps v0.0.0, which sorts older than any release, so the next
|
||||
// release install upgrades the file and stamps a proper version.
|
||||
cfgVer := version
|
||||
if cfgVer == "" || cfgVer == "dev" {
|
||||
cfgVer = "v0.0.0"
|
||||
}
|
||||
var b strings.Builder
|
||||
fmt.Fprintf(&b, "CFG_VER=%s\n", version)
|
||||
fmt.Fprintf(&b, "CFG_VER=%s\n", cfgVer)
|
||||
b.WriteString("# Config format reference, written by the installer — do not edit.\n")
|
||||
b.WriteString("# The installer uses it to append newly added settings on updates.\n\n")
|
||||
b.WriteString("# gpu-turnstile configuration\n")
|
||||
|
||||
Reference in New Issue
Block a user