mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-18 15:37:38 +00:00
Reformat everything
- Switch to a fairly standard code format. This is largely based on IntelliJ defaults, with some minor tweaks applied via editor config. Should mean people don't need to import a config! - Use "var" everywhere instead of explicit types. Type inference is a joy, and I intend to use it to its fullest. - Start using switch expressions: we couldn't use them before because IntelliJ does silly things with our previous brace style, but now we have the luxury of them!
This commit is contained in:
@@ -4,7 +4,6 @@ import org.codehaus.groovy.runtime.ProcessGroovyMethods
|
||||
import java.io.BufferedReader
|
||||
import java.io.IOException
|
||||
import java.io.InputStreamReader
|
||||
import java.util.stream.Collectors
|
||||
|
||||
internal object ProcessHelpers {
|
||||
fun startProcess(vararg command: String): Process {
|
||||
@@ -26,7 +25,7 @@ internal object ProcessHelpers {
|
||||
|
||||
fun captureLines(process: Process): List<String> {
|
||||
val out = BufferedReader(InputStreamReader(process.inputStream)).use { reader ->
|
||||
reader.lines().filter { it.isNotEmpty() }.collect(Collectors.toList())
|
||||
reader.lines().filter { it.isNotEmpty() }.toList()
|
||||
}
|
||||
ProcessGroovyMethods.closeStreams(process)
|
||||
if (process.waitFor() != 0) throw IOException("Command exited with a non-0 status")
|
||||
|
Reference in New Issue
Block a user