diff --git a/go.mod b/go.mod index f97525ce3..5ff07d2a8 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/Masterminds/semver v1.5.0 - github.com/alexellis/go-execute/v2 v2.1.0 + github.com/alexellis/go-execute/v2 v2.2.1 github.com/cheggaaa/pb/v3 v3.1.4 github.com/docker/go-units v0.5.0 github.com/google/go-containerregistry v0.16.1 diff --git a/go.sum b/go.sum index 939d46aa1..fefb54b17 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= -github.com/alexellis/go-execute/v2 v2.1.0 h1:0HccwWLNzAonu9Mei2bL8dQThHoaS1c/vq2hQwQW0XY= -github.com/alexellis/go-execute/v2 v2.1.0/go.mod h1:FMdRnUTiFAmYXcv23txrp3VYZfLo24nMpiIneWgKHTQ= +github.com/alexellis/go-execute/v2 v2.2.1 h1:4Ye3jiCKQarstODOEmqDSRCqxMHLkC92Bhse743RdOI= +github.com/alexellis/go-execute/v2 v2.2.1/go.mod h1:FMdRnUTiFAmYXcv23txrp3VYZfLo24nMpiIneWgKHTQ= github.com/cheggaaa/pb/v3 v3.1.4 h1:DN8j4TVVdKu3WxVwcRKu0sG00IIU6FewoABZzXbRQeo= github.com/cheggaaa/pb/v3 v3.1.4/go.mod h1:6wVjILNBaXMs8c21qRiaUM8BR82erfgau1DQ4iUXmSA= github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= diff --git a/vendor/github.com/alexellis/go-execute/v2/README.md b/vendor/github.com/alexellis/go-execute/v2/README.md index 64bbc276f..7f8788e9e 100644 --- a/vendor/github.com/alexellis/go-execute/v2/README.md +++ b/vendor/github.com/alexellis/go-execute/v2/README.md @@ -60,6 +60,7 @@ import ( "fmt" execute "github.com/alexellis/go-execute/v2" + "context" ) func main() { @@ -69,7 +70,7 @@ func main() { StreamStdio: false, } - res, err := cmd.Execute() + res, err := cmd.Execute(context.Background()) if err != nil { panic(err) } @@ -82,7 +83,6 @@ func main() { } ``` - ## Example with "shell" and exit-code 0 ```golang @@ -92,6 +92,7 @@ import ( "fmt" execute "github.com/alexellis/go-execute/v2" + "context" ) func main() { @@ -100,7 +101,7 @@ func main() { Args: []string{"-l"}, Shell: true, } - res, err := ls.Execute() + res, err := ls.Execute(context.Background()) if err != nil { panic(err) } @@ -117,6 +118,7 @@ package main import ( "fmt" + "context" execute "github.com/alexellis/go-execute/v2" ) @@ -125,7 +127,7 @@ func main() { Command: "exit 1", Shell: true, } - res, err := ls.Execute() + res, err := ls.Execute(context.Background()) if err != nil { panic(err) } diff --git a/vendor/github.com/alexellis/go-execute/v2/exec.go b/vendor/github.com/alexellis/go-execute/v2/exec.go index bc5ec4308..b1a7de7b4 100644 --- a/vendor/github.com/alexellis/go-execute/v2/exec.go +++ b/vendor/github.com/alexellis/go-execute/v2/exec.go @@ -151,9 +151,10 @@ func (et ExecTask) Execute(ctx context.Context) (ExecResult, error) { var stdoutWriters []io.Writer var stderrWriters []io.Writer - // Always capture to a buffer - stdoutWriters = append(stdoutWriters, &stdoutBuff) - stderrWriters = append(stderrWriters, &stderrBuff) + if !et.DisableStdioBuffer { + stdoutWriters = append(stdoutWriters, &stdoutBuff) + stderrWriters = append(stderrWriters, &stderrBuff) + } if et.StreamStdio { stdoutWriters = append(stdoutWriters, os.Stdout) diff --git a/vendor/modules.txt b/vendor/modules.txt index 3986f3ed9..e78586d33 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/Masterminds/semver # github.com/VividCortex/ewma v1.2.0 ## explicit; go 1.12 github.com/VividCortex/ewma -# github.com/alexellis/go-execute/v2 v2.1.0 +# github.com/alexellis/go-execute/v2 v2.2.1 ## explicit; go 1.20 github.com/alexellis/go-execute/v2 # github.com/cheggaaa/pb/v3 v3.1.4