From aa48f1f7712fa97babc7d1512749989ef68552e1 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 18 Jan 2017 22:59:27 +0700 Subject: [PATCH] quote newlines when interpolating --- agent/agent.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index 5e82e625f..408219620 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -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