Skip to content

Commit 129a45a

Browse files
chrisdrackettrandycoulman
authored andcommitted
Improve reliability of port hint. (facebook#1696)
* fixing things for people with the username `cwd` closes facebook#1694 * combine awk into a single command and add escaping
1 parent 8a0b577 commit 129a45a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-dev-utils/getProcessForPort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function getProcessCommand(processId, processDirectory) {
4343
}
4444

4545
function getDirectoryOfProcessById(processId) {
46-
return execSync('lsof -p '+ processId + ' | grep cwd | awk \'{print $9}\'', execOptions).trim();
46+
return execSync('lsof -p '+ processId + ' | awk \'$4=="cwd" {print $9}\'', execOptions).trim();
4747
}
4848

4949
function getProcessForPort(port) {

0 commit comments

Comments
 (0)