mirror of https://github.com/MedzikUser/go-pingbot
chore: disable auto updater if version is dev
This commit is contained in:
parent
fa03e08b28
commit
6af384e731
36
main.go
36
main.go
|
@ -96,25 +96,29 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.Toml.AutoUpdate.Enabled {
|
if config.Toml.AutoUpdate.Enabled {
|
||||||
wg.Add(1)
|
if config.Version == "dev" {
|
||||||
|
log.Warn("You using dev version. Auto Update DISABLED!")
|
||||||
|
} else {
|
||||||
|
wg.Add(1)
|
||||||
|
|
||||||
client := updater.Client{
|
client := updater.Client{
|
||||||
GitHub: config.GH_Repo,
|
GitHub: config.GH_Repo,
|
||||||
GitHubToken: config.GH_Token,
|
GitHubToken: config.GH_Token,
|
||||||
Version: config.Version,
|
Version: config.Version,
|
||||||
Binary: "pingbot.out",
|
Binary: "pingbot.out",
|
||||||
CheckEvery: config.Toml.AutoUpdate.Check * time.Minute,
|
CheckEvery: config.Toml.AutoUpdate.Check * time.Minute,
|
||||||
AfterUpdate: func() {
|
AfterUpdate: func() {
|
||||||
log.Info("Updated!")
|
log.Info("Updated!")
|
||||||
|
|
||||||
if !config.Toml.Options.Stop_After_Ping {
|
if !config.Toml.Options.Stop_After_Ping {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Major: false,
|
Major: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
go client.AutoUpdater()
|
||||||
}
|
}
|
||||||
|
|
||||||
go client.AutoUpdater()
|
|
||||||
} else {
|
} else {
|
||||||
log.Warn("Auto Update -> Disabled")
|
log.Warn("Auto Update -> Disabled")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue