Skip to content

Commit

Permalink
Display pid in already running message (facebook#3131)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pajn authored and thongdong7 committed Sep 24, 2017
1 parent e83cc13 commit f5df507
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/react-dev-utils/getProcessForPort.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ function getProcessCommand(processId, processDirectory) {
execOptions
);

command = command.replace(/\n$/, '')

if (isProcessAReactApp(command)) {
const packageName = getPackageNameInDirectory(processDirectory);
return packageName ? packageName + '\n' : command;
return packageName ? packageName : command;
} else {
return command;
}
Expand All @@ -68,7 +70,8 @@ function getProcessForPort(port) {
var processId = getProcessIdOnPort(port);
var directory = getDirectoryOfProcessById(processId);
var command = getProcessCommand(processId, directory);
return chalk.cyan(command) + chalk.blue(' in ') + chalk.cyan(directory);
return chalk.cyan(command) + chalk.grey(' (pid ' + processId + ')\n') +
chalk.blue(' in ') + chalk.cyan(directory);
} catch (e) {
return null;
}
Expand Down

0 comments on commit f5df507

Please sign in to comment.