Skip to content

Commit

Permalink
feat(rn): 优化启动文案提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Pines-Cheng committed Mar 31, 2020
1 parent 7f1e280 commit 8883d2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/taro-cli/src/rn/index.ts
Expand Up @@ -41,14 +41,15 @@ export async function build (
tcpPortUsed.check(port, '127.0.0.1').then((inUse) => {
if (inUse) {
console.log(chalk.yellow(`⚠️ 端口 ${port} 被占用,启动 Metro Server 失败!`))
console.log(chalk.yellow(`如果 Metro Server 已启动,请确保 Metro Server 监听目录为:${appPath}。`))
console.log('\n\n')
} else {
try {
startServerInNewWindow({port, appPath})
console.log(chalk.green(`启动 Metro Server 成功!`))
console.log(chalk.green(`启动 Metro Server 成功!监听目录:${appPath}`))
console.log('\n\n')
} catch (e) {
console.log(chalk.yellow('🙅 启动 Metro Server 失败,请在项目根目录下运行:react-native start 手动启动。'))
console.log(chalk.yellow(`🙅 启动 Metro Server 失败,请在${appPath}目录下运行:react-native start 手动启动。`))
console.log(chalk.red(e))
console.log('\n\n')
}
Expand Down

0 comments on commit 8883d2d

Please sign in to comment.