From e8d31bc21a6fb0c0415fa62e131217a29cb9703d Mon Sep 17 00:00:00 2001 From: Geoffrey Bachelet Date: Wed, 3 Jul 2013 20:07:25 -0400 Subject: [PATCH] provisioner/shell: execute script directly instead of using /bin/sh --- provisioner/shell/provisioner.go | 2 +- website/source/docs/provisioners/shell.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index 1f89bfa79..ee3b2b178 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -62,7 +62,7 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { } if p.config.ExecuteCommand == "" { - p.config.ExecuteCommand = "{{.Vars}} sh {{.Path}}" + p.config.ExecuteCommand = "chmod +x {{.Path}}; {{.Vars}} {{.Path}}" } if p.config.Inline != nil && len(p.config.Inline) == 0 { diff --git a/website/source/docs/provisioners/shell.html.markdown b/website/source/docs/provisioners/shell.html.markdown index 9dc0d64c0..d99299689 100644 --- a/website/source/docs/provisioners/shell.html.markdown +++ b/website/source/docs/provisioners/shell.html.markdown @@ -51,7 +51,7 @@ Optional parameters: `key=value`. * `execute_command` (string) - The command to use to execute the script. - By default this is `{{ .Vars }} sh {{ .Path }}`. The value of this is + By default this is `chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}`. The value of this is treated as [configuration template](/docs/templates/configuration- templates.html). There are two available variables: `Path`, which is the path to the script to run, and `Vars`, which is the list of