From 67841a911101ad2ba36ebcbb39a6e39fbb1f79e5 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 15 Feb 2022 11:40:18 +0100 Subject: [PATCH] pass env vars to command line --- shell-local/run.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell-local/run.go b/shell-local/run.go index a82f4ba7d4..71404db7c3 100644 --- a/shell-local/run.go +++ b/shell-local/run.go @@ -206,6 +206,12 @@ func createFlattenedEnvVars(config *Config) (string, error) { envVars[keyValue[0]] = strings.Replace(keyValue[1], "'", `'"'"'`, -1) } + for k, v := range config.Env { + // Store pair, replacing any single quotes in value so they parse + // correctly with required environment variable format + envVars[k] = strings.Replace(v, "'", `'"'"'`, -1) + } + // Create a list of env var keys in sorted order var keys []string for k := range envVars {