File tree Expand file tree Collapse file tree
src/main/kotlin/ai/devchat/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939.vscode /
4040
4141# ## Mac OS ###
42- .DS_Store
42+ .DS_Store
43+ tmp /
Original file line number Diff line number Diff line change @@ -45,15 +45,19 @@ class DevChatWrapper {
4545 return try {
4646 Log .info(" Executing command: " + java.lang.String .join(" " , pb.command()))
4747 val process = pb.start()
48- val exitCode = process.waitFor()
48+ val text = process.inputStream.bufferedReader().use(BufferedReader ::readText)
49+ val errors = process.errorStream.bufferedReader().use(BufferedReader ::readText)
50+ process.waitFor()
51+ val exitCode = process.exitValue()
52+
4953 if (exitCode != 0 ) {
50- val error = readOutput(process.errorStream)
51- Log .error(" Failed to execute command: $commands Exit Code: $exitCode Error: $error " )
54+ Log .error(" Failed to execute command: $commands Exit Code: $exitCode Error: $errors " )
5255 throw RuntimeException (
53- " Failed to execute command: $commands Exit Code: $exitCode Error: $error "
56+ " Failed to execute command: $commands Exit Code: $exitCode Error: $errors "
5457 )
58+ } else {
59+ text
5560 }
56- readOutput(process.inputStream)
5761 } catch (e: IOException ) {
5862 Log .error(" Failed to execute command: $commands " )
5963 throw RuntimeException (" Failed to execute command: $commands " , e)
You can’t perform that action at this time.
0 commit comments