From 8030be5e1ac9d1c657cb65e1b494e3bffe1420cc Mon Sep 17 00:00:00 2001 From: Guilherme Oliveira Date: Thu, 26 Nov 2015 15:25:57 +0100 Subject: [PATCH] makefile with update flag and cache final implementation for freebsd --- Makefile | 2 +- cache/cache.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8cd9fed..e6e2bba 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ BIN_NAME=buildbot-dashboard all: build test special-deps: - ${GO} get -d github.com/ghophp/buildbot-dashboard + ${GO} get -u -d github.com/ghophp/buildbot-dashboard deps: ${GO} get gopkg.in/check.v1 diff --git a/cache/cache.go b/cache/cache.go index 11b4d90..443fb51 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -5,10 +5,11 @@ import ( "io/ioutil" "os" "os/user" + "path/filepath" "time" ) -const InternalCacheFolder string = ".bbd/" +const InternalCacheFolder string = ".bbd" type Cache struct { refreshTime int @@ -26,7 +27,10 @@ func NewCache(t int) *Cache { return cc } - cc.path = usr.HomeDir + "/" + InternalCacheFolder + cc.path = usr.HomeDir + + string(filepath.Separator) + + InternalCacheFolder + + string(filepath.Separator) _, err = os.Stat(cc.path) if os.IsNotExist(err) {