fix: no need to care about identities when making a deletion
This commit is contained in:
parent
9bdc9c30c6
commit
d63c1fd77b
1 changed files with 2 additions and 9 deletions
11
cmd/del.go
11
cmd/del.go
|
|
@ -26,7 +26,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"filippo.io/age"
|
|
||||||
"github.com/gobwas/glob"
|
"github.com/gobwas/glob"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
@ -98,19 +97,13 @@ func del(cmd *cobra.Command, args []string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
identity, _ := loadIdentity()
|
|
||||||
var recipient *age.X25519Recipient
|
|
||||||
if identity != nil {
|
|
||||||
recipient = identity.Recipient()
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, dbName := range storeOrder {
|
for _, dbName := range storeOrder {
|
||||||
st := byStore[dbName]
|
st := byStore[dbName]
|
||||||
p, err := store.storePath(dbName)
|
p, err := store.storePath(dbName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
entries, err := readStoreFile(p, identity)
|
entries, err := readStoreFile(p, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -121,7 +114,7 @@ func del(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
entries = append(entries[:idx], entries[idx+1:]...)
|
entries = append(entries[:idx], entries[idx+1:]...)
|
||||||
}
|
}
|
||||||
if err := writeStoreFile(p, entries, recipient); err != nil {
|
if err := writeStoreFile(p, entries, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue