Yicong-Huang commented on code in PR #7141:
URL: https://github.com/apache/texera/pull/7141#discussion_r3787840130


##########
bin/local-dev/main.sh:
##########
@@ -593,6 +593,74 @@ fi
 # Both platform probes follow the same two steps: the interface backing the
 # default route first (most reliable on a laptop that may have wifi +
 # thunderbolt + tailscale all active), then a scan as a fallback.
+_detect_host_lan_ip_windows() {
+    local iface_details="" local_ip="" iface_name="" idx=""
+
+    local 
virt_excl="vEthernet|WSL|Hyper-V|VirtualBox|Docker|Bridge|tap|tun|cni|flannel|cali|kube|tailscale|zerotier|wg|McAfee"
+    # Use 'netsh interface ip show route' to find the list of interfaces
+    # associated with the 0.0.0.0/0 (default) route and trace the respective 
indices
+    local idx_list
+    idx_list=$(netsh interface ip show route 2>/dev/null | \
+            awk '{
+                for (i = 1; i < NF; i++) {
+                    if ($i == "0.0.0.0/0") {
+                            print $(i+1)
+                    }
+                }
+            }')
+
+    # Iterate through candidate indices, inspect adapter name and grab the 
first physical LAN IP
+    for idx in $idx_list; do
+        iface_details=$(netsh interface ip show addresses "$idx" 2>/dev/null)
+
+        # Skip if adapter name is empty or matches virtual/VPN exclusions
+        iface_name=$(echo "$iface_details" | awk -F'"' '/Configuration for 
interface/ {print $2}')
+        if [[ -z "$iface_name" ]] || echo "$iface_name" | grep -qiE 
"$virt_excl"; then
+            continue
+        fi
+ 

Review Comment:
   Verified: `main.sh:621` is now an empty line — the trailing space is gone. 
Resolving.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to