mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
provisioner/shell: escape single quotes [GH-2067]
This commit is contained in:
parent
f1cef0baae
commit
c549fce85e
1 changed files with 3 additions and 0 deletions
|
|
@ -145,6 +145,9 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
|
|||
errs = packer.MultiErrorAppend(errs,
|
||||
fmt.Errorf("Environment variable not in format 'key=value': %s", kv))
|
||||
} else {
|
||||
// Replace single quotes so they parse
|
||||
vs[1] = strings.Replace(vs[1], "'", `'"'"'`, -1)
|
||||
|
||||
// Single quote env var values
|
||||
p.config.Vars[idx] = fmt.Sprintf("%s='%s'", vs[0], vs[1])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue