Skip to content

Commit

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

closes #1694

* combine awk into a single command and add escaping
  • Loading branch information
chrisdrackett authored and Timer committed Mar 3, 2017
1 parent c7a9dae commit 59cab8f
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 59cab8f

Please sign in to comment.