Skip to content

Commit

Permalink
Fix environment variables in Exec plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpoth committed Sep 4, 2019
1 parent f4b4e19 commit 6d09c58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/auth/exec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const { execFile } = require('child_process'),
proc = require('process'),
os = require('os');

class ExecAuth {
Expand Down Expand Up @@ -34,9 +35,13 @@ class ExecAuth {
promise = Promise.resolve(this.auth_provider);
} else {
promise = new Promise((resolve, reject) => {
const env = {};
let env;
if(this.auth_provider.env) {
env = {};
this.auth_provider.env.forEach(kvp => env[kvp.name] = kvp.value);
if (proc.env) {
Object.assign(env, proc.env);
}
}
const process = execFile(this.auth_provider.command, this.auth_provider.args , { env }, (error, stdout, stderr) => {
cancel = function (){};
Expand Down

0 comments on commit 6d09c58

Please sign in to comment.