From df032b09a7d033fc8a6940092dbbfba7820385cc Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sat, 15 Dec 2018 15:43:40 -0200 Subject: [PATCH] Upgrade mvdan/sh --- go.mod | 2 +- go.sum | 4 ++-- internal/execext/exec.go | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 5c32219c..65ef7448 100644 --- a/go.mod +++ b/go.mod @@ -20,5 +20,5 @@ require ( golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f golang.org/x/sys v0.0.0-20180831094639-fa5fdf94c789 // indirect gopkg.in/yaml.v2 v2.2.1 - mvdan.cc/sh v0.0.0-20180829163519-3a244a89e2e5 + mvdan.cc/sh v2.6.2+incompatible ) diff --git a/go.sum b/go.sum index dc1118a4..d39ed9d2 100644 --- a/go.sum +++ b/go.sum @@ -41,5 +41,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -mvdan.cc/sh v0.0.0-20180829163519-3a244a89e2e5 h1:FKi9XtQO5aNipfQ/qnnLCoM6gdFwPQY702RRbNRxjK8= -mvdan.cc/sh v0.0.0-20180829163519-3a244a89e2e5/go.mod h1:IeeQbZq+x2SUGBensq/jge5lLQbS3XT2ktyp3wrt4x8= +mvdan.cc/sh v2.6.2+incompatible h1:WotkNlbcMnp2Lxz0M+j5bcSgLuvPQ8peEC394fx0vIg= +mvdan.cc/sh v2.6.2+incompatible/go.mod h1:IeeQbZq+x2SUGBensq/jge5lLQbS3XT2ktyp3wrt4x8= diff --git a/internal/execext/exec.go b/internal/execext/exec.go index 935d4d1c..35d617cf 100644 --- a/internal/execext/exec.go +++ b/internal/execext/exec.go @@ -7,6 +7,7 @@ import ( "os" "strings" + "mvdan.cc/sh/expand" "mvdan.cc/sh/interp" "mvdan.cc/sh/syntax" ) @@ -41,14 +42,10 @@ func RunCommand(ctx context.Context, opts *RunCommandOptions) error { if len(environ) == 0 { environ = os.Environ() } - env, err := interp.EnvFromList(environ) - if err != nil { - return err - } r, err := interp.New( interp.Dir(opts.Dir), - interp.Env(env), + interp.Env(expand.ListEnviron(environ...)), interp.Module(interp.DefaultExec), interp.Module(interp.OpenDevImpls(interp.DefaultOpen)),