From 29749809d28381ba568c45abbfc31e82f8ddaa9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 15 Dec 2014 16:17:20 +0100 Subject: [PATCH 1/3] Updated --- grafana | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grafana b/grafana index 79beefe57c6..634d8c99781 160000 --- a/grafana +++ b/grafana @@ -1 +1 @@ -Subproject commit 79beefe57c608b3cd933c5b1f772c8707731a64c +Subproject commit 634d8c9978190fb162c5e848b85bfcba029c4843 From 6c351c724d2d0e5127116604e47c6d23cdad9d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 15 Dec 2014 16:18:24 +0100 Subject: [PATCH 2/3] merged grafana upstream --- grafana | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grafana b/grafana index 634d8c99781..373118c5eec 160000 --- a/grafana +++ b/grafana @@ -1 +1 @@ -Subproject commit 634d8c9978190fb162c5e848b85bfcba029c4843 +Subproject commit 373118c5eecc5c3645254cb4b862124b55dae980 From 26ec8589030ec6488ad4798cf5a5c0bf6c8b3dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 15 Dec 2014 17:36:42 +0100 Subject: [PATCH 3/3] Moved grafana bin file to bin folder --- .bra.toml | 6 +++--- .gitignore | 2 +- Makefile | 2 +- pkg/setting/setting.go | 15 ++------------- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.bra.toml b/.bra.toml index c2e1503de2f..c2aa6eb72ed 100644 --- a/.bra.toml +++ b/.bra.toml @@ -1,5 +1,5 @@ [run] -init_cmds = [["./grafana-pro", "web"]] +init_cmds = [["./bin/grafana", "web"]] watch_all = true watch_dirs = [ "$WORKDIR/pkg", @@ -9,6 +9,6 @@ watch_dirs = [ watch_exts = [".go", ".ini"] build_delay = 1500 cmds = [ - ["go", "build", "./pkg/cmd/grafana-pro"], - ["./grafana-pro", "web"] + ["make", "build"], + ["./bin/grafana", "web"] ] diff --git a/.gitignore b/.gitignore index 65045bd264e..9aab95cfd73 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ config.js data/sessions data/*.db data/log -/grafana-pro +/bin/* diff --git a/Makefile b/Makefile index e2fbf75f946..e020fba76f3 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: build build: - go build ../pkg/cmd/grafana-pro/ + go build -o bin/grafana . setup: go get github.com/tools/godep diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 16184cfb9bc..33b9a608fbc 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -6,7 +6,6 @@ package setting import ( "net/url" "os" - "os/exec" "path" "path/filepath" "runtime" @@ -69,18 +68,8 @@ func init() { log.NewLogger(0, "console", `{"level": 0}`) } -// WorkDir returns absolute path of work directory. func WorkDir() (string, error) { - execPath, err := ExecPath() - return path.Dir(strings.Replace(execPath, "\\", "/", -1)), err -} - -func ExecPath() (string, error) { - file, err := exec.LookPath(os.Args[0]) - if err != nil { - return "", err - } - p, err := filepath.Abs(file) + p, err := filepath.Abs(".") if err != nil { return "", err } @@ -96,7 +85,7 @@ func NewConfigContext() { Cfg, err = goconfig.LoadConfigFile(path.Join(workDir, "conf/grafana.ini")) if err != nil { - log.Fatal(4, "Fail to parse 'conf/grafana.ini': %v", err) + log.Fatal(4, "Fail to parse '%v/conf/grafana.ini': %v", workDir, err) } CustomPath = os.Getenv("GRAFANA_CONF")