Check new version only for releases (#8107)

This commit is contained in:
andig 2023-05-20 17:14:59 +02:00 • committed by GitHub
parent f08dea2c47
commit 543d5b781a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View file

@ -156,7 +156,7 @@ export default {
return (
this.available && // available version already computed?
this.installed != "[[.Version]]" && // go template parsed?
this.installed != "0.0.1-alpha" && // make used?
this.installed != "0.0.0" && // make used?
this.available != this.installed
);
},
@ -172,7 +172,9 @@ export default {
}
},
releaseNotesUrl: function (version) {
return `https://github.com/evcc-io/evcc/releases/tag/${version}`;
return version == "0.0.0"
? `https://github.com/evcc-io/evcc/releases`
: `https://github.com/evcc-io/evcc/releases/tag/${version}`;
},
openModal() {
const modal = Modal.getOrCreateInstance(document.getElementById("updateModal"));

View file

@ -259,9 +259,11 @@ func runRoot(cmd *cobra.Command, args []string) {
site.DumpConfig()
site.Prepare(valueChan, pushChan)
// show and check version
valueChan <- util.Param{Key: "version", Val: server.FormattedVersion()}
go updater.Run(log, httpd, valueChan)
// show and check version, reduce api load during development
if server.Version != server.DevVersion {
valueChan <- util.Param{Key: "version", Val: server.FormattedVersion()}
go updater.Run(log, httpd, valueChan)
}
// expose sponsor to UI
if sponsor.Subject != "" {

View file

@ -2,9 +2,11 @@ package server
import "fmt"
const DevVersion = "0.0.0"
var (
// Version of executable
Version = "0.0.1-alpha"
Version = DevVersion
// Commit of executable
Commit = ""