quote newlines when interpolating

This commit is contained in:
Brad Rydzewski 2017-01-18 22:59:27 +07:00
parent 2bb64949d1
commit aa48f1f771

View file

@ -96,7 +96,11 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
var err error
w.Yaml, err = envsubst.Eval(w.Yaml, func(s string) string {
return envs[s]
env := envs[s]
if strings.Contains(env, "\n") {
env = fmt.Sprintf("%q", env)
}
return env
})
if err != nil {
return nil, err