mirror of
https://github.com/grafana/grafana.git
synced 2025-09-26 03:04:09 +08:00
Fix build-in plugins failing to load in windows (#25982)
This commit is contained in:

committed by
GitHub

parent
039367336c
commit
bcaa42fbb3
@ -3,6 +3,7 @@ package plugins
|
|||||||
import (
|
import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/setting"
|
"github.com/grafana/grafana/pkg/setting"
|
||||||
@ -63,7 +64,9 @@ func (fp *FrontendPluginBase) handleModuleDefaults() {
|
|||||||
// Previously there was an assumption that the plugin directory
|
// Previously there was an assumption that the plugin directory
|
||||||
// should be public/app/plugins/<plugin type>/<plugin id>
|
// should be public/app/plugins/<plugin type>/<plugin id>
|
||||||
// However this can be an issue if the plugin directory should be renamed to something else
|
// However this can be an issue if the plugin directory should be renamed to something else
|
||||||
currentDir := path.Base(fp.PluginDir)
|
currentDir := filepath.Base(fp.PluginDir)
|
||||||
|
// use path package for the following statements
|
||||||
|
// because these are not file paths
|
||||||
fp.Module = path.Join("app/plugins", fp.Type, currentDir, "module")
|
fp.Module = path.Join("app/plugins", fp.Type, currentDir, "module")
|
||||||
fp.BaseUrl = path.Join("public/app/plugins", fp.Type, currentDir)
|
fp.BaseUrl = path.Join("public/app/plugins", fp.Type, currentDir)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user