From 151f08f9f7a5b1bcc98946495ec01539085e2474 Mon Sep 17 00:00:00 2001 From: Chris Drackett Date: Fri, 3 Mar 2017 10:03:07 -0800 Subject: [PATCH] Improve reliability of port hint. (#1696) * fixing things for people with the username `cwd` closes #1694 * combine awk into a single command and add escaping --- packages/react-cy-dev-utils/getProcessForPort.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-cy-dev-utils/getProcessForPort.js b/packages/react-cy-dev-utils/getProcessForPort.js index bf0ddc2d405..7b7ce0bd4f0 100644 --- a/packages/react-cy-dev-utils/getProcessForPort.js +++ b/packages/react-cy-dev-utils/getProcessForPort.js @@ -43,7 +43,7 @@ function getProcessCommand(processId, processDirectory) { } function getDirectoryOfProcessById(processId) { - return execSync('lsof -p '+ processId + ' | grep cwd | awk \'{print $9}\'', execOptions).trim(); + return execSync('lsof -p '+ processId + ' | awk \'$4=="cwd" {print $9}\'', execOptions).trim(); } function getProcessForPort(port) {