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()
}