package util

import (
	"cicv-data-closedloop/common/config/c_log"
	"os/exec"
)

func Execute(name string, arg ...string) (*exec.Cmd, string, error) {
	cmd := exec.Command(name, arg...)
	combinedOutput, err := cmd.CombinedOutput()
	if err != nil {
		c_log.GlobalLogger.Info("命令", name, " ", arg, "执行出错:", err)
		return nil, string(combinedOutput), err
	}
	return cmd, string(combinedOutput), nil
}
