From b8aba50b2b751b93e7d5573513a871579b11b42c Mon Sep 17 00:00:00 2001 From: Mohamed Daahir Date: Thu, 12 Nov 2020 05:38:59 +0000 Subject: [PATCH] limit outputted remote urls to one (#1574) * limit outputted remote urls to one * pass a single remote ip instead of a list --- snowpack/src/commands/dev.ts | 4 ++-- snowpack/src/commands/paint.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/snowpack/src/commands/dev.ts b/snowpack/src/commands/dev.ts index 5ae5b3f015..768b401f9c 100644 --- a/snowpack/src/commands/dev.ts +++ b/snowpack/src/commands/dev.ts @@ -1296,7 +1296,7 @@ export async function startDevServer(commandOptions: CommandOptions): Promise [...every, ...(i || [])], []) .filter((i) => i.family === 'IPv4' && i.internal === false) .map((i) => i.address); @@ -1305,7 +1305,7 @@ export async function startDevServer(commandOptions: CommandOptions): Promise { } export function getServerInfoMessage( - {startTimeMs, port, protocol, hostname, ips}: ServerInfo, + {startTimeMs, port, protocol, hostname, remoteIp}: ServerInfo, isBuilding = false, ) { let output = ''; const isServerStarted = startTimeMs > 0 && port > 0 && protocol; if (isServerStarted) { output += ` ${colors.bold(colors.cyan(`${protocol}//${hostname}:${port}`))}`; - for (const ip of ips) { - output += `${colors.cyan(` • `)}${colors.bold(colors.cyan(`${protocol}//${ip}:${port}`))}`; + if (remoteIp) { + output += `${colors.cyan(` • `)}${colors.bold(colors.cyan(`${protocol}//${remoteIp}:${port}`))}`; } output += '\n'; output += colors.dim( @@ -104,7 +104,7 @@ interface ServerInfo { hostname: string; protocol: string; startTimeMs: number; - ips: string[]; + remoteIp?: string; } interface WorkerState {