1
0

Add debug logs for exec.Command

This commit is contained in:
2023-03-19 13:14:14 +00:00
parent 305c6972ca
commit 08beba2bab
6 changed files with 53 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ import (
"code.dumpstack.io/tools/out-of-tree/config"
"code.dumpstack.io/tools/out-of-tree/qemu"
"github.com/rs/zerolog/log"
)
type ImageCmd struct {
@@ -146,6 +147,8 @@ func unpackTar(archive, destination string) (err error) {
cmd := exec.Command("tar", "-Sxf", archive)
cmd.Dir = destination + "/"
log.Debug().Msgf("%v", cmd)
rawOutput, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%v: %s", err, rawOutput)