minimal implementation for pmg

This commit is contained in:
Sahilb315
2025-04-09 23:27:46 +05:30
parent 4805f443f5
commit ed8f9b6d53
13 changed files with 188 additions and 68 deletions
+21
View File
@@ -0,0 +1,21 @@
package utils
import (
"bytes"
"fmt"
"os/exec"
)
func ExecCmd(name string, args []string) error {
cmd := exec.Command(name, args...)
var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
if err := cmd.Run(); err != nil {
return fmt.Errorf("error running cmd %s: %s\nStderr: %s", name,
err.Error(), stderr.String())
}
return nil
}