Skip to content

Commit 59cab8f

Browse files
chrisdrackettTimer
authored andcommitted
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
1 parent c7a9dae commit 59cab8f

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)