mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Moved grafana bin file to bin folder
This commit is contained in:
parent
6c351c724d
commit
26ec858903
@ -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"]
|
||||
]
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -17,4 +17,4 @@ config.js
|
||||
data/sessions
|
||||
data/*.db
|
||||
data/log
|
||||
/grafana-pro
|
||||
/bin/*
|
||||
|
2
Makefile
2
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
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user