fix: don't fail on empty socket file

This commit is contained in:
Alexis Tyler
2020-12-05 07:47:50 +10:30
parent fcc54df830
commit 15fbec795a

View File

@@ -119,9 +119,9 @@ if (isNaN(parseInt(port, 10))) {
// Check if the process that made this file is still alive
const pid = await execa.command(`lsof -t ${port}`)
.then(output => {
const pids = cleanStdout(output).split('\n');
return pids[0];
});
const pids = cleanStdout(output).split('\n');
return pids[0];
}).catch(() => undefined);
// Try to kill it?
if (pid) {