Plugins: Update CLI check if plugin is already installed (#91213)

* check if plugin installed

* undo remove initial vers check

* still attempt deps
This commit is contained in:
Will Browne
2024-08-06 09:21:40 +01:00
committed by GitHub
parent da291998cf
commit 9300c1bbea
3 changed files with 29 additions and 9 deletions
+3 -3
View File
@@ -88,14 +88,14 @@ func GetLocalPlugins(pluginDir string) []*plugins.FoundBundle {
return res
}
func PluginVersionInstalled(pluginID, version, pluginDir string) bool {
func PluginVersionInstalled(pluginID, version, pluginDir string) (plugins.FoundPlugin, bool) {
for _, bundle := range GetLocalPlugins(pluginDir) {
pJSON := bundle.Primary.JSONData
if pJSON.ID == pluginID {
if pJSON.Info.Version == version {
return true
return bundle.Primary, true
}
}
}
return false
return plugins.FoundPlugin{}, false
}