grafana-cli: Fix file path processing, returning of errors (#26954)

* grafana-cli: Fix file path processing, returning of errors
This commit is contained in:
Arve Knudsen
2020-08-13 09:38:05 +02:00
committed by GitHub
parent 75e14aa120
commit 9f159c5e3d
5 changed files with 78 additions and 93 deletions
+1 -2
View File
@@ -2,7 +2,6 @@ package utils
import (
"os"
"path"
"path/filepath"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
@@ -26,7 +25,7 @@ func getGrafanaRoot() (string, error) {
return "", errutil.Wrap("failed to get executable path", err)
}
exPath := filepath.Dir(ex)
_, last := path.Split(exPath)
_, last := filepath.Split(exPath)
if last == "bin" {
// In dev env the executable for current platform is created in 'bin/' dir
return filepath.Join(exPath, ".."), nil