From 974c37f5ac42d64de2b667249273170579aab64b Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Mon, 15 Feb 2016 17:22:06 -0500 Subject: [PATCH] Bumped version Former-commit-id: 5e192a6399227a3a5e2fea5d2edb9909a0f7082d [formerly 86ff88b2c1b4105d5714505260617c707d16d3a1] [formerly 067ff986f8031cf22266756e3b4446e99b672433 [formerly 477838db7b979014e6e7c72d45a8a917fe81f07e]] Former-commit-id: 79df6b5b8c1b885419dac3a36ba7268463882d7b [formerly 3c8f5bc04ead1f3b535a838350c22859c2a8a5a6] Former-commit-id: c0469a373651bda29a09c73aa7ea753273e86458 --- Makefile | 12 +++++++++++- main.go | 15 +++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 85bf405..1f9408c 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,18 @@ binaries: rm -f awwkoala mkdir binaries env GOOS=linux GOARCH=amd64 go build -o awwkoala -v *.go - zip -9 -r awwkoala-linux-amd64.zip awwkoala static/* templates/* + zip -9 -r awwkoala-linux-64bit.zip awwkoala static/* templates/* rm -f awwkoala + env GOOS=windows GOARCH=amd64 go build -o awwkoala.exe -v *.go + zip -9 -r awwkoala-windows-64bit.zip awwkoala.exe static/* templates/* + rm -f awwkoala.exe + env GOOS=linux GOARCH=arm go build -o awwkoala -v *.go + zip -9 -r awwkoala-raspberrypi.zip awwkoala static/* templates/* + rm -f awwkoala + env GOOS=darwin GOARCH=amd64 go build -o awwkoala -v *.go + zip -9 -r awwkoala-macosx-64bit.zip awwkoala static/* templates/* + rm -f awwkoala + mv *.zip binaries/ .PHONY: install diff --git a/main.go b/main.go index 2da460e..9fb6fad 100644 --- a/main.go +++ b/main.go @@ -4,10 +4,8 @@ import ( "flag" "fmt" "io/ioutil" - "log" "os" "path" - "runtime" "github.com/boltdb/bolt" "github.com/gin-gonic/gin" @@ -37,8 +35,8 @@ var RuntimeArgs struct { var VersionNum string func main() { - VersionNum = "1.1" - _, executableFile, _, _ := runtime.Caller(0) // get full path of this file + VersionNum = "1.2" + // _, executableFile, _, _ := runtime.Caller(0) // get full path of this file cwd, _ := os.Getwd() databaseFile := path.Join(cwd, "data.db") flag.StringVar(&RuntimeArgs.Port, "p", ":8003", "port to bind") @@ -63,7 +61,7 @@ Options:`) if RuntimeArgs.ExternalIP == "" { RuntimeArgs.ExternalIP = GetLocalIP() + RuntimeArgs.Port } - RuntimeArgs.SourcePath = path.Dir(executableFile) + RuntimeArgs.SourcePath = cwd Open(RuntimeArgs.DatabaseLocation) defer Close() @@ -87,7 +85,6 @@ Options:`) // var q WikiData // q.load("about") // fmt.Println(getImportantVersions(q)) - log.Println(RuntimeArgs.AdminKey) r := gin.Default() r.LoadHTMLGlob(path.Join(RuntimeArgs.SourcePath, "templates/*")) @@ -100,13 +97,15 @@ Options:`) if RuntimeArgs.ServerCRT != "" && RuntimeArgs.ServerKey != "" { RuntimeArgs.Socket = "wss" fmt.Println("--------------------------") - fmt.Println("AwwKoala is up and running on https://" + RuntimeArgs.ExternalIP) + fmt.Println("AwwKoala (version " + VersionNum + ") is up and running on https://" + RuntimeArgs.ExternalIP) + fmt.Println("Admin key: " + RuntimeArgs.AdminKey) fmt.Println("--------------------------") r.RunTLS(RuntimeArgs.Port, RuntimeArgs.ServerCRT, RuntimeArgs.ServerKey) } else { RuntimeArgs.Socket = "ws" fmt.Println("--------------------------") - fmt.Println("AwwKoala is up and running on http://" + RuntimeArgs.ExternalIP) + fmt.Println("AwwKoala (version " + VersionNum + ") is up and running on http://" + RuntimeArgs.ExternalIP) + fmt.Println("Admin key: " + RuntimeArgs.AdminKey) fmt.Println("--------------------------") r.Run(RuntimeArgs.Port) }