Skip to content

Commit

Permalink
fix: Adjust wording for dev server port taken messages (#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie authored Sep 11, 2023
1 parent bae48a7 commit 45c868f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/cli-tools/src/handlePortUnavailable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const handlePortUnavailable = async (
port = nextPort;
} else {
packager = false;
logChangePortInstructions(port);
logChangePortInstructions();
}
}

Expand Down
13 changes: 6 additions & 7 deletions packages/cli-tools/src/port.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import {prompt} from './prompt';
import logger from './logger';
import chalk from 'chalk';

export const askForPortChange = async (port: number, nextPort: number) => {
logger.info(
`Metro is already running on port ${chalk.bold(port)} in another project.`,
);
logger.info(`Another process is running on port ${port}.`);
return await prompt({
name: 'change',
type: 'select',
Expand All @@ -18,11 +15,13 @@ export const askForPortChange = async (port: number, nextPort: number) => {
};

export const logAlreadyRunningBundler = (port: number) => {
logger.info(`Metro Bundler is already for this project on port ${port}.`);
logger.info(
`A dev server is already running for this project on port ${port}.`,
);
};

export const logChangePortInstructions = (port: number) => {
export const logChangePortInstructions = () => {
logger.info(
`Please close the other packager running on port ${port}, or select another port with "--port".`,
'Please terminate this process and try again, or use another port with "--port".',
);
};

0 comments on commit 45c868f

Please sign in to comment.