mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
provisioner: set InlineShebang based on Inline content
This commit is contained in:
parent
cceac7f462
commit
c1db3bf8fa
1 changed files with 5 additions and 1 deletions
|
|
@ -112,7 +112,11 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
|
|||
}
|
||||
|
||||
if p.config.InlineShebang == "" {
|
||||
p.config.InlineShebang = "/bin/sh -e"
|
||||
if p.config.Inline != nil && len(p.config.Inline) > 0 && strings.HasPrefix(p.config.Inline[0], "#!") {
|
||||
p.config.InlineShebang = strings.TrimPrefix(p.config.Inline[0], "#!")
|
||||
} else {
|
||||
p.config.InlineShebang = "/bin/sh -e"
|
||||
}
|
||||
}
|
||||
|
||||
if p.config.StartRetryTimeout == 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue