🎨 Clean code

This commit is contained in:
Daniel 2023-10-22 16:48:14 +08:00
parent 654c2a47a7
commit c85804039d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -39,11 +39,9 @@ func BazaarPlugins(frontend, keyword string) (plugins []*bazaar.Plugin) {
for _, plugin := range plugins {
plugin.Installed = util.IsPathRegularDirOrSymlinkDir(filepath.Join(util.DataDir, "plugins", plugin.Name))
if plugin.Installed {
if plugin.Installed {
if pluginConf, err := bazaar.PluginJSON(plugin.Name); nil == err && nil != plugin {
if plugin.Version != pluginConf.Version {
plugin.Outdated = true
}
if pluginConf, err := bazaar.PluginJSON(plugin.Name); nil == err && nil != plugin {
if plugin.Version != pluginConf.Version {
plugin.Outdated = true
}
}
}
@ -112,11 +110,9 @@ func BazaarWidgets(keyword string) (widgets []*bazaar.Widget) {
for _, widget := range widgets {
widget.Installed = util.IsPathRegularDirOrSymlinkDir(filepath.Join(util.DataDir, "widgets", widget.Name))
if widget.Installed {
if widget.Installed {
if widgetConf, err := bazaar.WidgetJSON(widget.Name); nil == err && nil != widget {
if widget.Version != widgetConf.Version {
widget.Outdated = true
}
if widgetConf, err := bazaar.WidgetJSON(widget.Name); nil == err && nil != widget {
if widget.Version != widgetConf.Version {
widget.Outdated = true
}
}
}