Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 488a487

Browse files
committed
Fix killing previous process on Linux and OSX
1 parent 01be9bf commit 488a487

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/VueCliMiddleware/Util/KillPort.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ public static bool Kill(int pid, bool force = false, bool tree = true)
175175
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
176176
{
177177
if (force) { args.Add("-9"); }
178-
RunProcessReturnOutput("kill", "");
178+
args.Add(pid.ToString());
179+
RunProcessReturnOutput("kill", string.Join(" ", args));
179180
}
180181
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
181182
{
182183
if (force) { args.Add("-9"); }
183-
RunProcessReturnOutput("kill", "");
184+
args.Add(pid.ToString());
185+
RunProcessReturnOutput("kill", string.Join(" ", args));
184186
}
185187
else
186188
{

0 commit comments

Comments
 (0)