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

Commit 93b6577

Browse files
authored
Merge pull request #43 from lafriks-fork/fix/kill_linux
Fix killing previous process on Linux and OSX
2 parents 01be9bf + 488a487 commit 93b6577

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)