package mrepo

import (
	"os/exec"
	"strings"
)

//Make invoke make on the prj with the target as argument.
func Make(prj, target string) (result string, err error) {
	cmd := exec.Command("make", target)
	cmd.Dir = prj
	out, err := cmd.CombinedOutput()
	if err != nil {
		return
	}
	result = strings.Trim(string(out), "\n \t")
	return result, nil
}

package mrepo

import (
	"io"
	"os/exec"
)

//Make invoke make on the prj with the target as argument.
func Make(prj, target string, buf io.Writer) (err error) {
	cmd := exec.Command("make", target)
	cmd.Dir = prj
	cmd.Stdout = buf
	cmd.Stderr = buf
	return cmd.Run()
}

Make cmd now suport buffer passing
Make cmd now suport buffer passing
