Skip to content

Commit

Permalink
perform better environment setting
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Kim <[email protected]>
  • Loading branch information
Oats87 committed Mar 17, 2021
1 parent cb2edd9 commit d41c0ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/applyinator/applyinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ func (a *Applyinator) execute(ctx context.Context, directory string, instruction
}
cmd := exec.CommandContext(ctx, instruction.Command, instruction.Args...)
logrus.Infof("Running command: %s %v", instruction.Command, instruction.Args)
cmd.Env = append(os.Environ(), instruction.Env...)
cmd.Env = append(os.Environ(), fmt.Sprintf("CATTLE_AGENT_EXECUTION_PWD=%s", directory))
cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, instruction.Env...)
cmd.Env = append(cmd.Env, fmt.Sprintf("CATTLE_AGENT_EXECUTION_PWD=%s", directory))
cmd.Env = append(cmd.Env, "PATH="+os.Getenv("PATH")+":"+directory)

stdout, err := cmd.StdoutPipe()
Expand Down

0 comments on commit d41c0ad

Please sign in to comment.