Commit 952077cc authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

provisioner/shell: set -e for inline [GH-2069]

parent 9c1e4614
......@@ -184,6 +184,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
// Write our contents to it
writer := bufio.NewWriter(tf)
writer.WriteString(fmt.Sprintf("#!%s\n", p.config.InlineShebang))
writer.WriteString("set -e\n")
for _, command := range p.config.Inline {
if _, err := writer.WriteString(command + "\n"); err != nil {
return fmt.Errorf("Error preparing shell script: %s", err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment