nix-amer/internal/pkg/apk.go

26 lines
449 B
Go

package pkg
import (
"os/exec"
)
type Apk struct{}
func (d Apk) Name() string { return "apk" }
func (d Apk) Fetch() error {
return exec.Command(d.Name(), "update").Run()
}
func (d Apk) Upgrade() error {
return exec.Command(d.Name(), "upgrade").Run()
}
func (d Apk) Install(_pkg string) error {
return exec.Command(d.Name(), "add", _pkg).Run()
}
func (d Apk) Remove(_pkg string) error {
return exec.Command(d.Name(), "del", _pkg).Run()
}