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 e9bb11d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/auth/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class ExecAuth {
promise = Promise.resolve(this.auth_provider);
} else {
promise = new Promise((resolve, reject) => {
const env = {};
const env = Object.assign({}, process.env);
if(this.auth_provider.env) {
this.auth_provider.env.forEach(kvp => env[kvp.name] = kvp.value);
}
const process = execFile(this.auth_provider.command, this.auth_provider.args , { env }, (error, stdout, stderr) => {
const exec = execFile(this.auth_provider.command, this.auth_provider.args , { env }, (error, stdout, stderr) => {
cancel = function (){};
if (error) {
reject(error);
}
resolve(stdout);
});
cancel = function() { process.kill() };
cancel = function() { exec.kill() };
});
promise = promise.then( response => {
const json = JSON.parse(response);
Expand Down

0 comments on commit e9bb11d

Please sign in to comment.