chore(mac): dedupe local gateway label

This commit is contained in:
Peter Steinberger
2025-12-09 19:13:46 +00:00
parent 6ae4c49c1a
commit 0bf9a87293

View File

@@ -110,15 +110,19 @@ enum GatewayEnvironment {
let gatewayLabel = gatewayBin != nil ? "global" : "local"
let gatewayVersionText = installed?.description ?? "unknown"
// Avoid repeating "(local)" twice; if using the local entrypoint, show the path once.
let localPathHint = gatewayBin == nil && projectEntrypoint != nil
? " (local: \(projectEntrypoint ?? "unknown"))"
: ""
let gatewayLabelText = gatewayBin != nil
? "(\(gatewayLabel))"
: localPathHint.isEmpty ? "(\(gatewayLabel))" : localPathHint
return GatewayEnvironmentStatus(
kind: .ok,
nodeVersion: runtime.version.description,
gatewayVersion: gatewayVersionText,
requiredGateway: expected?.description,
message: "Node \(runtime.version.description); gateway \(gatewayVersionText) (\(gatewayLabel))\(localPathHint)")
message: "Node \(runtime.version.description); gateway \(gatewayVersionText) \(gatewayLabelText)")
}
}