summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-09 23:15:14 +0800
committerruki <[email protected]>2026-02-09 23:15:14 +0800
commitff21702cec1348b5ae84526210650bdfd356f4dd (patch)
tree4a4091c893432c0b4746253e7cc937703f0e5ba9
parentee65b3630b4e48948491a3584c2406ed224b1534 (diff)
fix review issue
-rw-r--r--xmake/modules/private/service/remote_build/client.lua18
1 files changed, 4 insertions, 14 deletions
diff --git a/xmake/modules/private/service/remote_build/client.lua b/xmake/modules/private/service/remote_build/client.lua
index 93b3bf6c9..09ac126a6 100644
--- a/xmake/modules/private/service/remote_build/client.lua
+++ b/xmake/modules/private/service/remote_build/client.lua
@@ -469,20 +469,10 @@ function remote_build_client:_init_host()
if host_name then
-- find host by name or address
for _, host in ipairs(remote_build_config.hosts) do
- local host_ip, host_port = host.connect:split(":", {plain = true})
-
- -- match by name
- if host.name == host_name then
- address = host.connect
- token = host.token
- break
- -- match by full address
- elseif host.connect == host_name then
- address = host.connect
- token = host.token
- break
- -- match by IP only (when user doesn't specify port)
- elseif host_ip == host_name and not host_name:find(":", 1, true) then
+ local host_ip, _ = host.connect:split(":", {plain = true})
+ if host.name == host_name or
+ host.connect == host_name or
+ (host_ip == host_name and not host_name:find(":", 1, true)) then
address = host.connect
token = host.token
break