@@ -77,6 +77,8 @@ val deployPlugin by tasks.registering {
7777 description = " Deploy plugin to running IDEs"
7878 dependsOn(tasks.buildPlugin)
7979 doLast {
80+ logging.captureStandardOutput(LogLevel .WARN )
81+
8082 val zip = tasks.buildPlugin.get().outputs.files.singleFile
8183 val home = File (System .getProperty(" user.home" ))
8284 val endpoints = home.listFiles { f -> f.name.matches(Regex (" \\ .\\ d+\\ .hot-reload" )) }
@@ -92,14 +94,17 @@ val deployPlugin by tasks.registering {
9294 endpoints.forEach { (url, token) ->
9395 println (" \n → $url " )
9496 val conn = (URI (url).toURL().openConnection() as HttpURLConnection ).apply {
95- requestMethod = " POST" ; doOutput = true
97+ requestMethod = " POST" ; doOutput = true ; doInput = true
9698 setRequestProperty(" Authorization" , token)
9799 setRequestProperty(" Content-Type" , " application/octet-stream" )
98100 connectTimeout = 5000 ; readTimeout = 300000
99101 }
100102 conn.outputStream.use { out -> zip.inputStream().use { it.copyTo(out ) } }
101103 if (conn.responseCode in 200 .. 299 ) {
102- conn.inputStream.bufferedReader().forEachLine { println (" $it " ) }
104+ conn.inputStream.buffered().readAllBytes()
105+ .toString(Charsets .UTF_8 )
106+ .lines()
107+ .forEach { println (" $it " ) }
103108 } else {
104109 println (" ✗ HTTP ${conn.responseCode} " )
105110 }
0 commit comments