Skip to content

Commit 84fe4ae

Browse files
support multiple env vars (#540)
1 parent c5d8e85 commit 84fe4ae

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/interface/cli/commands/hybrid/init.cmd.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ const initCmd = new Command({
213213
const detectedProxyVars = detectProxy();
214214
httpProxy = httpProxy || detectedProxyVars.httpProxy;
215215
httpsProxy = httpsProxy || detectedProxyVars.httpsProxy;
216+
envVars = envVars || [];
217+
if (!Array.isArray(envVars)) {
218+
envVars = [envVars];
219+
}
216220
if (noQuestions) {
217221
// use defaults
218222
kubeContextName = kubeContextName || getKubeContext(kubeConfigPath);
@@ -342,10 +346,12 @@ const initCmd = new Command({
342346
}
343347

344348
if (httpProxy) {
345-
envVars = _.merge(envVars || {}, { http_proxy: httpProxy, HTTP_PROXY: httpProxy });
349+
envVars.push(`http_proxy=${httpProxy}`);
350+
envVars.push(`HTTP_PROXY=${httpProxy}`);
346351
}
347352
if (httpsProxy) {
348-
envVars = _.merge(envVars || {}, { https_proxy: httpsProxy, HTTPS_PROXY: httpsProxy });
353+
envVars.push(`https_proxy=${httpsProxy}`);
354+
envVars.push(`HTTPS_PROXY=${httpsProxy}`);
349355
}
350356

351357
// save the answers for backup

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.71.2",
3+
"version": "0.71.3",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)