Merge pull request #6199 from DanHam/ps-and-win-sh-cleanup-tmp
Clean up temp files created for PowerShell and Windows-Shell inline provisioner's
This commit is contained in:
commit
2650d59499
|
@ -269,6 +269,8 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
|
|||
ui.Error(fmt.Sprintf("Unable to extract inline scripts into a file: %s", err))
|
||||
}
|
||||
scripts = append(scripts, temp)
|
||||
// Remove temp script containing the inline commands when done
|
||||
defer os.Remove(temp)
|
||||
}
|
||||
|
||||
for _, path := range scripts {
|
||||
|
|
|
@ -190,6 +190,8 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
|
|||
ui.Error(fmt.Sprintf("Unable to extract inline scripts into a file: %s", err))
|
||||
}
|
||||
scripts = append(scripts, temp)
|
||||
// Remove temp script containing the inline commands when done
|
||||
defer os.Remove(temp)
|
||||
}
|
||||
|
||||
for _, path := range scripts {
|
||||
|
|
Loading…
Reference in New Issue