Timeout when invoking the shell, log information to the console

- Partially addresses #13084
This commit is contained in:
Joe Fitzgerald
2016-11-10 14:23:08 -07:00
parent e9b471a24f
commit 7dfc99989f

View File

@@ -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')) {