Skip to content
Clone

fix(dev): start the dev daemon through Start-Process

The WMI launch left the daemon without a working console, so Ctrl+C and
its log stream never reached the terminal. Start it as a hidden process
and keep the handle.
ZhenYi committed
parent a78765e commit 0172b0e Browse files

1 file changed

+3 −7

Modified scripts/dev.ps1 View scripts/dev.ps1
@@ -186,13 +186,9 @@
186186 )
187187 Set-Content -LiteralPath $launcher -Value $lines -Encoding ascii
188188
189 $cmd = 'cmd.exe /c "' + $launcher + '"'
190 $result = Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{
191 CommandLine = $cmd
192 CurrentDirectory = $WorkingDirectory
193 }
194 if ($result.ReturnValue -ne 0) { throw "Win32_Process.Create failed (return=$($result.ReturnValue))" }
195 return [int]$result.ProcessId
189 $proc = Start-Process -FilePath 'cmd.exe' -ArgumentList @('/c', ('"{0}"' -f $launcher)) `
190 -WorkingDirectory $WorkingDirectory -WindowStyle Hidden -PassThru
191 return [int]$proc.Id
196192}
197193
198194function Start-One {