summaryrefslogtreecommitdiff
path: root/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'exec.go')
-rw-r--r--exec.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/exec.go b/exec.go
index c5fb298..49294d2 100644
--- a/exec.go
+++ b/exec.go
@@ -49,6 +49,28 @@ func ExecCheck(args []string) error {
return nil
}
+func PathExecVerbose(path string, args []string) error {
+ if len(args) == 0 {
+ return errors.New("Error: Command slice is empty.")
+ }
+
+ // Start a long-running process, capture stdout and stderr
+ a, b := RemoveFirstElement(args)
+
+ process := exec.Command(a, b...)
+ process.Dir = path
+ process.Stderr = os.Stderr
+ process.Stdin = os.Stdin
+ process.Stdout = os.Stdout
+ err := process.Run()
+ if err != nil {
+ log.Info("ExecCheck() err", err)
+ return err
+ }
+ // log.Info("ExecCheck() nil")
+ return nil
+}
+
func SudoRaw(c []string) {
args := []string{"-S"}
args = append(args, c...)