🎨 Plugin uninstall

This commit is contained in:
Liang Ding 2023-05-06 10:38:38 +08:00
parent 6eb3673b6e
commit 439c1e6f8a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -80,12 +80,13 @@ func UninstallBazaarPlugin(pluginName string) error {
} }
petals := getPetals() petals := getPetals()
var tmp []*Petal
for i, petal := range petals { for i, petal := range petals {
if petal.Name == pluginName { if petal.Name != pluginName {
petals = append(petals[:i], petals[i+1:]...) tmp = append(tmp, petals[i])
break
} }
} }
petals = tmp
savePetals(petals) savePetals(petals)
return nil return nil
} }