2020-02-24 23:40:55 -05:00
|
|
|
package version
|
|
|
|
|
2020-03-03 13:52:52 -05:00
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
|
|
|
"github.com/fatih/color"
|
|
|
|
)
|
|
|
|
|
2020-04-08 00:15:46 -04:00
|
|
|
var AgentVersion = "1.0.6"
|
2020-03-03 13:52:52 -05:00
|
|
|
|
|
|
|
func CheckAgentVersion(latestVer string) {
|
|
|
|
log.Println("Current agent version:", AgentVersion)
|
|
|
|
|
|
|
|
if AgentVersion < latestVer {
|
2020-04-01 15:58:17 -04:00
|
|
|
log.Println("Latest agent version:", latestVer)
|
2020-03-03 13:52:52 -05:00
|
|
|
yc := color.New(color.FgYellow)
|
|
|
|
yc.Println()
|
|
|
|
yc.Println(" ************************************************************")
|
|
|
|
yc.Println(" * WARNING: you version of agent is outdated! *")
|
|
|
|
yc.Println(" * *")
|
|
|
|
yc.Println(" * Please download the latest version from: *")
|
|
|
|
yc.Println(" * https://indihub.space/downloads *")
|
|
|
|
yc.Println(" * *")
|
|
|
|
yc.Println(" ************************************************************")
|
|
|
|
yc.Println(" ")
|
|
|
|
}
|
|
|
|
}
|