mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Merge pull request #13186 from atom/jf-timeout-invoking-env
Timeout when invoking the shell, log information to the console
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user