nix-amer/internal/pkg/eopkg.go

31 lines
567 B
Go

package pkg
import (
"os/exec"
)
type eopkg struct{}
func (d eopkg) Name() string { return "eopkg" }
func (d eopkg) Fetch() error {
return nil
}
func (d eopkg) Upgrade() error {
err := exec.Command(d.Name(), "upgrade").Run()
exec.Command(d.Name(), "remove-orphans").Run()
return err
}
func (d eopkg) Install(_pkg string) error {
err := exec.Command(d.Name(), "install", _pkg).Run()
return err
}
func (d eopkg) Remove(_pkg string) error {
err := exec.Command(d.Name(), "remove", _pkg).Run()
exec.Command(d.Name(), "remove-orphans").Run()
return err
}