Explorar el Código

Still set currentVersion if update checking is disabled

jamesread hace 4 años
padre
commit
395c5bea99
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      internal/updatecheck/updateCheck.go

+ 2 - 2
internal/updatecheck/updateCheck.go

@@ -41,13 +41,13 @@ func machineID() string {
 // StartUpdateChecker will start a job that runs periodically, checking
 // StartUpdateChecker will start a job that runs periodically, checking
 // for updates.
 // for updates.
 func StartUpdateChecker(currentVersion string, currentCommit string, cfg *config.Config) {
 func StartUpdateChecker(currentVersion string, currentCommit string, cfg *config.Config) {
+	CurrentVersion = currentVersion
+
 	if !cfg.CheckForUpdates {
 	if !cfg.CheckForUpdates {
 		log.Warn("Update checking is disabled")
 		log.Warn("Update checking is disabled")
 		return
 		return
 	}
 	}
 
 
-	CurrentVersion = currentVersion
-
 	payload := updateRequest{
 	payload := updateRequest{
 		CurrentVersion: currentVersion,
 		CurrentVersion: currentVersion,
 		CurrentCommit:  currentCommit,
 		CurrentCommit:  currentCommit,