yay/vendor/github.com/Morganamilo/go-pacmanconf/cmd.go

21 lines
336 B
Go
Raw Normal View History

2018-09-11 00:07:19 +02:00
package pacmanconf
import (
"bytes"
"os/exec"
)
func pacmanconf(args []string) (string, string, error) {
var outbuf, errbuf bytes.Buffer
cmd := exec.Command("pacman-conf", args...)
cmd.Stdout = &outbuf
cmd.Stderr = &errbuf
err := cmd.Run()
stdout := outbuf.String()
stderr := errbuf.String()
return stdout, stderr, err
}