diff --git a/src/update-process-env.js b/src/update-process-env.js index 6544a6612..227f0914f 100644 --- a/src/update-process-env.js +++ b/src/update-process-env.js @@ -63,7 +63,18 @@ function getEnvFromShell (env) { return } - let {stdout} = spawnSync(env.SHELL, ['-ilc', 'command env'], {encoding: 'utf8'}) + let {stdout, error, status, signal} = spawnSync(env.SHELL, ['-ilc', 'command env'], {encoding: 'utf8', timeout: 5000}) + if (error) { + if (error.handle) { + error.handle() + } + console.log(error) + } + + if (status !== 0) { + console.log('warning: ' + env.SHELL + '-ilc "command env" failed with status (' + status + ') and signal (' + signal + ')') + } + if (stdout) { let result = {} for (let line of stdout.split('\n')) {