From 5adac86b43eb57b80f891593d5b9cdde53f02cc4 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 15 Feb 2016 14:19:59 +0100 Subject: [PATCH] fix(cli): remove dev text values --- pkg/cmd/grafana-cli/commands/commands.go | 4 ++-- pkg/cmd/grafana-cli/commands/install_command.go | 5 ++--- pkg/cmd/grafana-cli/main.go | 14 +++++++------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pkg/cmd/grafana-cli/commands/commands.go b/pkg/cmd/grafana-cli/commands/commands.go index 1f85366b18d..7854e45b77a 100644 --- a/pkg/cmd/grafana-cli/commands/commands.go +++ b/pkg/cmd/grafana-cli/commands/commands.go @@ -22,7 +22,7 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C var Commands = []cli.Command{ { Name: "install", - Usage: "installs stuff", + Usage: "installs a plugin", Action: runCommand(installCommand), }, { Name: "list-remote", @@ -42,7 +42,7 @@ var Commands = []cli.Command{ Action: runCommand(lsCommand), }, { Name: "remove", - Usage: "removes stuff", + Usage: "removes installed plugin", Action: runCommand(removeCommand), }, } diff --git a/pkg/cmd/grafana-cli/commands/install_command.go b/pkg/cmd/grafana-cli/commands/install_command.go index f8c2452d1eb..f3de4cfb5d6 100644 --- a/pkg/cmd/grafana-cli/commands/install_command.go +++ b/pkg/cmd/grafana-cli/commands/install_command.go @@ -77,10 +77,9 @@ func InstallPlugin(pluginName, pluginFolder, version string) error { res := services.ReadPlugin(pluginFolder, pluginName) for _, v := range res.Dependency.Plugins { - log.Infof("Depends on %s install!\n", v.Id) + log.Infof("Installing Dependency: %s\n", v.Id) - //Todo: uncomment this code once the repo is more correct. - //InstallPlugin(v.Id, pluginFolder, "") + InstallPlugin(v.Id, pluginFolder, "") } return err diff --git a/pkg/cmd/grafana-cli/main.go b/pkg/cmd/grafana-cli/main.go index 7023ad738bf..a04d1511397 100644 --- a/pkg/cmd/grafana-cli/main.go +++ b/pkg/cmd/grafana-cli/main.go @@ -11,14 +11,14 @@ import ( ) func getGrafanaPluginPath() string { - os := runtime.GOOS - if os == "linux" { - return "/var/lib/grafana/plugins" - } else if os == "windows" { - return "C:\\opt\\grafana\\plugins" // :& - } + //TODO: try to get path from os:env GF_PLUGIN_FOLDER - return "tmp_do/" //based on your OS! + os := runtime.GOOS + if os == "windows" { + return "C:\\opt\\grafana\\plugins" + } else { + return "/var/lib/grafana/plugins" + } } func main() {