Skip to content

Commit

Permalink
Improve reliability of port hint. (facebook#1696)
Browse files Browse the repository at this point in the history
* fixing things for people with the username `cwd`

closes facebook#1694

* combine awk into a single command and add escaping
  • Loading branch information
chrisdrackett authored and SpaceK33z committed Mar 7, 2017
1 parent fa4b31e commit 151f08f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-cy-dev-utils/getProcessForPort.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 151f08f

Please sign in to comment.