chore(mac): dedupe local gateway label
This commit is contained in:
@@ -110,15 +110,19 @@ enum GatewayEnvironment {
|
|||||||
|
|
||||||
let gatewayLabel = gatewayBin != nil ? "global" : "local"
|
let gatewayLabel = gatewayBin != nil ? "global" : "local"
|
||||||
let gatewayVersionText = installed?.description ?? "unknown"
|
let gatewayVersionText = installed?.description ?? "unknown"
|
||||||
|
// Avoid repeating "(local)" twice; if using the local entrypoint, show the path once.
|
||||||
let localPathHint = gatewayBin == nil && projectEntrypoint != nil
|
let localPathHint = gatewayBin == nil && projectEntrypoint != nil
|
||||||
? " (local: \(projectEntrypoint ?? "unknown"))"
|
? " (local: \(projectEntrypoint ?? "unknown"))"
|
||||||
: ""
|
: ""
|
||||||
|
let gatewayLabelText = gatewayBin != nil
|
||||||
|
? "(\(gatewayLabel))"
|
||||||
|
: localPathHint.isEmpty ? "(\(gatewayLabel))" : localPathHint
|
||||||
return GatewayEnvironmentStatus(
|
return GatewayEnvironmentStatus(
|
||||||
kind: .ok,
|
kind: .ok,
|
||||||
nodeVersion: runtime.version.description,
|
nodeVersion: runtime.version.description,
|
||||||
gatewayVersion: gatewayVersionText,
|
gatewayVersion: gatewayVersionText,
|
||||||
requiredGateway: expected?.description,
|
requiredGateway: expected?.description,
|
||||||
message: "Node \(runtime.version.description); gateway \(gatewayVersionText) (\(gatewayLabel))\(localPathHint)")
|
message: "Node \(runtime.version.description); gateway \(gatewayVersionText) \(gatewayLabelText)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user