Refactor to add oci and util packages
Signed-off-by: Mrunal Patel <mrunalp@gmail.com> Change the sandbox directory path Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
839463d837
commit
ac1340488d
7 changed files with 101 additions and 76 deletions
19
utils/utils.go
Normal file
19
utils/utils.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func ExecCmd(name string, args ...string) (string, error) {
|
||||
cmd := exec.Command(name, args...)
|
||||
var out bytes.Buffer
|
||||
cmd.Stdout = &out
|
||||
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return out.String(), nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue