Skip to content

Commit

Permalink
Adding os environment keys to cmd environment
Browse files Browse the repository at this point in the history
Signed-off-by: rcmadhankumar <[email protected]>
  • Loading branch information
rcmadhankumar committed Nov 3, 2023
1 parent 606e658 commit 465703b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/pkg/kctrl/local/detailed_cmd_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package local
import (
"fmt"
"io"
"os"
goexec "os/exec"

"github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec"
Expand All @@ -28,6 +29,9 @@ func (r DetailedCmdRunner) Run(cmd *goexec.Cmd) error {
cmd.Stderr = io.MultiWriter(r.log, cmd.Stderr)
}

// Adding os environment keys to cmd environment
cmd.Env = append(os.Environ(), cmd.Env...)

fmt.Fprintf(r.log, "==> Executing %s %v\n", cmd.Path, cmd.Args)
defer fmt.Fprintf(r.log, "==> Finished executing %s\n\n", cmd.Path)

Expand Down

0 comments on commit 465703b

Please sign in to comment.