Skip to content

Commit

Permalink
now using 'sh' instead of 'bash' to execute terraform command and add…
Browse files Browse the repository at this point in the history
…ed docs about v and env after review
  • Loading branch information
Anubhav Mishra committed Sep 25, 2017
1 parent 637cbeb commit db31eda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions terraform/terraform_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ func (c *Client) Version() *version.Version {
}

// RunCommandWithVersion executes the provided version of terraform with
// the provided args in path.
// the provided args in path. The variable "v" is the version of terraform executable to use and the variable "env" is the
// environment specified by the user commenting "atlantis plan/apply {env}" which is set to "default" by default.
func (c *Client) RunCommandWithVersion(log *logging.SimpleLogger, path string, args []string, v *version.Version, env string) (string, error) {
tfExecutable := "terraform"
// if version is the same as the default, don't need to prepend the version name to the executable
Expand All @@ -75,7 +76,7 @@ func (c *Client) RunCommandWithVersion(log *logging.SimpleLogger, path string, a
// append terraform executable name with args
tfCmd := fmt.Sprintf("%s %s", tfExecutable, strings.Join(args, " "))

terraformCmd := exec.Command("bash", "-c", tfCmd)
terraformCmd := exec.Command("sh", "-c", tfCmd)
terraformCmd.Dir = path
terraformCmd.Env = envVars
out, err := terraformCmd.CombinedOutput()
Expand Down

0 comments on commit db31eda

Please sign in to comment.