mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-01-12 22:46:30 +08:00
committed by
Joe Haddad
parent
89bf273ec8
commit
2cff8db00b
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user