Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
95f3e520
Commit
95f3e520
authored
Mar 08, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(cli): use commandline object all the way
parent
da2b65cd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
pkg/cmd/grafana-cli/commands/install_command.go
+5
-4
pkg/cmd/grafana-cli/commands/upgrade_all_command.go
+1
-1
pkg/cmd/grafana-cli/commands/upgrade_command.go
+1
-1
No files found.
pkg/cmd/grafana-cli/commands/install_command.go
View file @
95f3e520
...
...
@@ -49,11 +49,12 @@ func installCommand(c CommandLine) error {
log
.
Infof
(
"version: %v
\n
"
,
version
)
}
return
InstallPlugin
(
pluginToInstall
,
pluginFolder
,
version
,
c
.
GlobalString
(
"repo"
)
)
return
InstallPlugin
(
pluginToInstall
,
version
,
c
)
}
func
InstallPlugin
(
pluginName
,
pluginFolder
,
version
,
repoUrl
string
)
error
{
plugin
,
err
:=
s
.
GetPlugin
(
pluginName
,
repoUrl
)
func
InstallPlugin
(
pluginName
,
version
string
,
c
CommandLine
)
error
{
plugin
,
err
:=
s
.
GetPlugin
(
pluginName
,
c
.
GlobalString
(
"repo"
))
pluginFolder
:=
c
.
GlobalString
(
"path"
)
if
err
!=
nil
{
return
err
}
...
...
@@ -85,7 +86,7 @@ func InstallPlugin(pluginName, pluginFolder, version, repoUrl string) error {
res
,
_
:=
s
.
ReadPlugin
(
pluginFolder
,
pluginName
)
for
_
,
v
:=
range
res
.
Dependency
.
Plugins
{
InstallPlugin
(
v
.
Id
,
pluginFolder
,
""
,
repoUrl
)
InstallPlugin
(
v
.
Id
,
version
,
c
)
log
.
Infof
(
"Installed Dependency: %v ✔
\n
"
,
v
.
Id
)
}
...
...
pkg/cmd/grafana-cli/commands/upgrade_all_command.go
View file @
95f3e520
...
...
@@ -54,7 +54,7 @@ func upgradeAllCommand(c CommandLine) error {
log
.
Infof
(
"Upgrading %v
\n
"
,
p
.
Id
)
s
.
RemoveInstalledPlugin
(
pluginDir
,
p
.
Id
)
InstallPlugin
(
p
.
Id
,
pluginDir
,
""
,
c
.
GlobalString
(
"repo"
)
)
InstallPlugin
(
p
.
Id
,
""
,
c
)
}
return
nil
...
...
pkg/cmd/grafana-cli/commands/upgrade_command.go
View file @
95f3e520
...
...
@@ -24,7 +24,7 @@ func upgradeCommand(c CommandLine) error {
if
localPlugin
.
Id
==
v
.
Id
{
if
ShouldUpgrade
(
localPlugin
.
Info
.
Version
,
v
)
{
s
.
RemoveInstalledPlugin
(
pluginDir
,
pluginName
)
return
InstallPlugin
(
localPlugin
.
Id
,
pluginDir
,
""
,
c
.
GlobalString
(
"repo"
)
)
return
InstallPlugin
(
localPlugin
.
Id
,
""
,
c
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment