From be5d04827a6e5ae654e17dca816a6174b9cdf945 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 4 Apr 2021 00:28:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9D=80=E6=AD=BB?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E6=8A=A5=E9=94=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/shell/scripts/kill-by-port.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/shell/scripts/kill-by-port.js b/packages/core/src/shell/scripts/kill-by-port.js index 2738e79e..ba834ff2 100644 --- a/packages/core/src/shell/scripts/kill-by-port.js +++ b/packages/core/src/shell/scripts/kill-by-port.js @@ -3,7 +3,7 @@ const execute = Shell.execute const executor = { async windows (exec, { port }) { - const cmds = [`for /f "tokens=5" %a in ('netstat -aon ^| find ":${port}" ^| find "LISTENING"') do taskkill /f /pid %a`] + const cmds = [`for /f "tokens=5" %a in ('netstat -aon ^| find ":${port}" ^| find "LISTENING"') do (taskkill /f /pid %a & exit /B) `] // eslint-disable-next-line no-unused-vars const ret = await exec(cmds, { type: 'cmd' }) return true