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 Timer committed Mar 4, 2017
1 parent 9f0b1db commit e359159
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-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 e359159

Please sign in to comment.