From 34b8f7c926e4e0089ee6b913592e14796a8e368a Mon Sep 17 00:00:00 2001 From: Belac Darkstorm Date: Mon, 3 Apr 2017 09:23:41 -0500 Subject: [PATCH] Forgot to implement updating --- main.go | 18 ++++++++++++++++++ update.go | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 535e6ee..d8b3b74 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,8 @@ package main import ( + "fmt" + "github.com/nelsam/gxui" "github.com/nelsam/gxui/drivers/gl" "github.com/nelsam/gxui/themes/dark" @@ -25,6 +27,22 @@ var ( ) func main() { + stat := versionDL() + if stat { + res := getVersionFileInfo() + if res != "Error!" { + stat = checkForUpdate(res) + if stat { + downloadUpdate(res) + } else { + fmt.Println("Failed DL") + } + } else { + fmt.Println("Failed Version File Info") + } + } else { + fmt.Println("Failed Version DL") + } master = make(map[string][]app) linmaster = make(map[string][]app) gl.StartDriver(appMain) diff --git a/update.go b/update.go index e863d5d..bfb236e 100644 --- a/update.go +++ b/update.go @@ -56,8 +56,8 @@ func getVersionFileInfo() string { return string(out) } -func checkForUpdate(cur string, new string) bool { - curSlice := strings.Split(cur, ".") +func checkForUpdate(new string) bool { + curSlice := strings.Split(version, ".") newSlice := strings.Split(new, ".") curNums := make([]int, 4) newNums := make([]int, 4)