I am currently trying to write a little wrapper around post-review to automatically post however this function fails when it comes to Dim results As String = sOut.ReadToEnd()
and I can;t suss out why,
Edit: It doesn't produce an error it just seems to go into ReadToEnd() never to return
Am I just missing something obvious?
Function postReview() As String
Dim psi As ProcessStartInfo = New System.Diagnostics.ProcessStartInfo("cmd.exe")
psi.UseShellExecute = False
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
psi.RedirectStandardError = True
Dim proc As Process = System.Diagnostics.Process.Start(psi)
Dim strm As StreamReader = proc.StandardError
Dim sOut As StreamReader = proc.StandardOutput
Dim sIn As StreamWriter = proc.StandardInput
MsgBox()
sIn.WriteLine("cd " & IO.Directory.GetCurrentDirectory)
sIn.WriteLine(Me.ToString)
sIn.WriteLine("post-review.py -d --username=User --password=Pass")
Dim results As String = sOut.ReadToEnd()
sIn.WriteLine("exit")
sIn.Close()
sOut.Close()
Return results
End Function
Further Info: The actual command is working as I can see it posting to Review Board. But it just seems to get stuck in a loop while waiting on the Stream to complete.
I have tried with Read and Readline with no luck