@dbalabka/chrome-wsl 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chrome-wsl +0 -9
- package/package.json +1 -1
package/chrome-wsl
CHANGED
|
@@ -118,10 +118,6 @@ port_listening_info() {
|
|
|
118
118
|
run_powershell "\$conns = Get-NetTCPConnection -LocalPort ${PORT} -ErrorAction SilentlyContinue | Select-Object -Property LocalAddress,LocalPort,RemoteAddress,RemotePort,State,OwningProcess; foreach (\$c in \$conns) { \$p = Get-Process -Id \$c.OwningProcess -ErrorAction SilentlyContinue; \$name = if (\$p) { \$p.Name } else { 'unknown' }; Write-Output (\"{0}:{1} owner={2} pid={3} state={4}\" -f \$c.LocalAddress, \$c.LocalPort, \$name, \$c.OwningProcess, \$c.State) }"
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
port_in_use_by_non_chrome() {
|
|
122
|
-
run_powershell "if (Get-NetTCPConnection -LocalPort ${PORT} -ErrorAction SilentlyContinue | Where-Object { \$p = Get-Process -Id \_.OwningProcess -ErrorAction SilentlyContinue; -not (\$p -and \$p.Name -eq 'chrome') }) { exit 0 } else { exit 1 }"
|
|
123
|
-
}
|
|
124
|
-
|
|
125
121
|
get_wsl_host_ip() {
|
|
126
122
|
local host_ip
|
|
127
123
|
host_ip=$(ip route | awk '/^default via / {print $3; exit}')
|
|
@@ -267,11 +263,6 @@ start_chrome() {
|
|
|
267
263
|
fi
|
|
268
264
|
fi
|
|
269
265
|
|
|
270
|
-
if port_in_use_by_non_chrome; then
|
|
271
|
-
err "Port ${PORT} is already in use by another process (not Chrome); details:"
|
|
272
|
-
port_listening_info
|
|
273
|
-
fi
|
|
274
|
-
|
|
275
266
|
local chrome_pid
|
|
276
267
|
chrome_pid=$(run_powershell "$chrome_cmd" | tr -d '\r' | head -n 1)
|
|
277
268
|
if [[ -n "${chrome_pid:-}" ]]; then
|