Adds pm rm

This commit is contained in:
sm
2018-03-06 21:46:25 -08:00
parent f07b5a7d0e
commit 51c8c920a3
3 changed files with 72 additions and 3 deletions
+10
View File
@@ -24,6 +24,16 @@ func AddInstalled(root string, m pm.Meta) error {
return savei(root, db)
}
// RemoveInstalled adds m to the installed package database.
func RemoveInstalled(root string, m pm.Meta) error {
db, err := loadi(root)
if err != nil {
return errors.Wrap(err, "loading installed db")
}
delete(db, m.Name)
return savei(root, db)
}
// IsInstalled checks if m is in the installed package database.
func IsInstalled(root string, m pm.Meta) (bool, error) {
db, err := loadi(root)