From bcaa42fbb3ff28eb289d62c43145f8f1484180a7 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki Date: Wed, 1 Jul 2020 18:23:18 +0300 Subject: [PATCH] Fix build-in plugins failing to load in windows (#25982) --- pkg/plugins/frontend_plugin.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/plugins/frontend_plugin.go b/pkg/plugins/frontend_plugin.go index e28d0a2106a..89464a30138 100644 --- a/pkg/plugins/frontend_plugin.go +++ b/pkg/plugins/frontend_plugin.go @@ -3,6 +3,7 @@ package plugins import ( "net/url" "path" + "path/filepath" "strings" "github.com/grafana/grafana/pkg/setting" @@ -63,7 +64,9 @@ func (fp *FrontendPluginBase) handleModuleDefaults() { // Previously there was an assumption that the plugin directory // should be public/app/plugins// // 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.BaseUrl = path.Join("public/app/plugins", fp.Type, currentDir) }