Skip to content

Commit 48ddd78

Browse files
Pajnthongdong7
authored andcommitted
Display pid in already running message (facebook#3131)
Fixes facebook#3106
1 parent 03b4c05 commit 48ddd78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/react-dev-utils/getProcessForPort.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ function getProcessCommand(processId, processDirectory) {
4848
execOptions
4949
);
5050

51+
command = command.replace(/\n$/, '')
52+
5153
if (isProcessAReactApp(command)) {
5254
const packageName = getPackageNameInDirectory(processDirectory);
53-
return packageName ? packageName + '\n' : command;
55+
return packageName ? packageName : command;
5456
} else {
5557
return command;
5658
}
@@ -68,7 +70,8 @@ function getProcessForPort(port) {
6870
var processId = getProcessIdOnPort(port);
6971
var directory = getDirectoryOfProcessById(processId);
7072
var command = getProcessCommand(processId, directory);
71-
return chalk.cyan(command) + chalk.blue(' in ') + chalk.cyan(directory);
73+
return chalk.cyan(command) + chalk.grey(' (pid ' + processId + ')\n') +
74+
chalk.blue(' in ') + chalk.cyan(directory);
7275
} catch (e) {
7376
return null;
7477
}

0 commit comments

Comments
 (0)