@@ -41,8 +41,8 @@ class CoderCLIManager @JvmOverloads constructor(private val deploymentURL: URL,
41
41
// necessary character set.
42
42
val host = getSafeHost(deploymentURL)
43
43
val subdir = if (deploymentURL.port > 0 ) " ${host} -${deploymentURL.port} " else host
44
- localBinaryPath = destinationDir.resolve(subdir).resolve(binaryName)
45
- coderConfigPath = destinationDir.resolve(subdir).resolve(" config" )
44
+ localBinaryPath = destinationDir.resolve(subdir).resolve(binaryName).toAbsolutePath()
45
+ coderConfigPath = destinationDir.resolve(subdir).resolve(" config" ).toAbsolutePath()
46
46
}
47
47
48
48
/* *
@@ -84,7 +84,7 @@ class CoderCLIManager @JvmOverloads constructor(private val deploymentURL: URL,
84
84
val etag = getBinaryETag()
85
85
val conn = remoteBinaryUrl.openConnection() as HttpURLConnection
86
86
if (etag != null ) {
87
- logger.info(" Found existing binary at ${ localBinaryPath.toAbsolutePath()} ; calculated hash as $etag " )
87
+ logger.info(" Found existing binary at $localBinaryPath ; calculated hash as $etag " )
88
88
conn.setRequestProperty(" If-None-Match" , " \" $etag \" " )
89
89
}
90
90
conn.setRequestProperty(" Accept-Encoding" , " gzip" )
@@ -94,7 +94,7 @@ class CoderCLIManager @JvmOverloads constructor(private val deploymentURL: URL,
94
94
logger.info(" GET ${conn.responseCode} $remoteBinaryUrl " )
95
95
when (conn.responseCode) {
96
96
HttpURLConnection .HTTP_OK -> {
97
- logger.info(" Downloading binary to ${ localBinaryPath.toAbsolutePath()} " )
97
+ logger.info(" Downloading binary to $localBinaryPath " )
98
98
Files .createDirectories(localBinaryPath.parent)
99
99
conn.inputStream.use {
100
100
Files .copy(
@@ -113,7 +113,7 @@ class CoderCLIManager @JvmOverloads constructor(private val deploymentURL: URL,
113
113
}
114
114
115
115
HttpURLConnection .HTTP_NOT_MODIFIED -> {
116
- logger.info(" Using cached binary at ${ localBinaryPath.toAbsolutePath()} " )
116
+ logger.info(" Using cached binary at $localBinaryPath " )
117
117
return false
118
118
}
119
119
}
@@ -140,7 +140,7 @@ class CoderCLIManager @JvmOverloads constructor(private val deploymentURL: URL,
140
140
} catch (e: FileNotFoundException ) {
141
141
null
142
142
} catch (e: Exception ) {
143
- logger.warn(" Unable to calculate hash for ${ localBinaryPath.toAbsolutePath()} " , e)
143
+ logger.warn(" Unable to calculate hash for $localBinaryPath " , e)
144
144
null
145
145
}
146
146
}
@@ -156,7 +156,7 @@ class CoderCLIManager @JvmOverloads constructor(private val deploymentURL: URL,
156
156
" --token" ,
157
157
token,
158
158
" --global-config" ,
159
- coderConfigPath.toAbsolutePath(). toString(),
159
+ coderConfigPath.toString(),
160
160
)
161
161
}
162
162
@@ -179,7 +179,7 @@ class CoderCLIManager @JvmOverloads constructor(private val deploymentURL: URL,
179
179
"""
180
180
Host ${getHostName(deploymentURL, it)}
181
181
HostName coder.${it.name}
182
- ProxyCommand "${ localBinaryPath.toAbsolutePath()} " --global-config "${ coderConfigPath.toAbsolutePath()} " ssh --stdio ${it.name}
182
+ ProxyCommand "$localBinaryPath " --global-config "$coderConfigPath " ssh --stdio ${it.name}
183
183
ConnectTimeout 0
184
184
StrictHostKeyChecking no
185
185
UserKnownHostsFile /dev/null
0 commit comments