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
af1c8dc5
Commit
af1c8dc5
authored
Jun 23, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(cli): adds support for dist/plugin.json location for plugins
ref #5410
parent
2123fbdf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
pkg/cmd/grafana-cli/services/services.go
+14
-2
No files found.
pkg/cmd/grafana-cli/services/services.go
View file @
af1c8dc5
...
@@ -33,11 +33,23 @@ func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
...
@@ -33,11 +33,23 @@ func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
}
}
func
ReadPlugin
(
pluginDir
,
pluginName
string
)
(
m
.
InstalledPlugin
,
error
)
{
func
ReadPlugin
(
pluginDir
,
pluginName
string
)
(
m
.
InstalledPlugin
,
error
)
{
distPluginDataPath
:=
path
.
Join
(
pluginDir
,
pluginName
,
"dist"
,
"plugin.json"
)
var
data
[]
byte
var
err
error
data
,
err
=
IoHelper
.
ReadFile
(
distPluginDataPath
)
if
err
!=
nil
{
pluginDataPath
:=
path
.
Join
(
pluginDir
,
pluginName
,
"plugin.json"
)
pluginDataPath
:=
path
.
Join
(
pluginDir
,
pluginName
,
"plugin.json"
)
pluginData
,
_
:=
IoHelper
.
ReadFile
(
pluginDataPath
)
data
,
err
=
IoHelper
.
ReadFile
(
pluginDataPath
)
if
err
!=
nil
{
return
m
.
InstalledPlugin
{},
errors
.
New
(
"Could not find dist/plugin.json or plugin.json on "
+
pluginName
+
" in "
+
pluginDir
)
}
}
res
:=
m
.
InstalledPlugin
{}
res
:=
m
.
InstalledPlugin
{}
json
.
Unmarshal
(
pluginD
ata
,
&
res
)
json
.
Unmarshal
(
d
ata
,
&
res
)
if
res
.
Info
.
Version
==
""
{
if
res
.
Info
.
Version
==
""
{
res
.
Info
.
Version
=
"0.0.0"
res
.
Info
.
Version
=
"0.0.0"
...
...
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