in ide-launcher/src/main/kotlin/com/intellij/remoterobot/launcher/utils.kt [7:26]
fun extractTar(tarFile: Path, to: Path): List<Path> {
return getCreatedFilesAfter(to) {
check(
ProcessBuilder()
.command("which", "tar")
.start()
.waitFor() == 0
) { "tar binary is not found" }
check(
ProcessBuilder()
.command(
"tar", "xzf",
tarFile.toAbsolutePath().toString(),
"-C", to.toAbsolutePath().toString()
)
.start()
.waitFor() == 0
) { "failed to extract $tarFile" }
}
}