🎨 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()
var tmp []*Petal
for i, petal := range petals {
if petal.Name == pluginName {
petals = append(petals[:i], petals[i+1:]...)
break
if petal.Name != pluginName {
tmp = append(tmp, petals[i])
}
}
petals = tmp
savePetals(petals)
return nil
}