File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
main/kotlin/com/coder/gateway/settings
test/kotlin/com/coder/gateway/settings Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ open class CoderSettings(
40
40
*/
41
41
fun dataDir (url : URL ): Path {
42
42
val dir = if (state.dataDirectory.isBlank()) dataDir
43
- else Path .of(expand(state.dataDirectory)).toAbsolutePath()
44
- return withHost(dir, url)
43
+ else Path .of(expand(state.dataDirectory))
44
+ return withHost(dir, url).toAbsolutePath()
45
45
}
46
46
47
47
/* *
@@ -67,8 +67,8 @@ open class CoderSettings(
67
67
fun binPath (url : URL , forceDownloadToData : Boolean = false): Path {
68
68
val binaryName = getCoderCLIForOS(getOS(), getArch())
69
69
val dir = if (forceDownloadToData || state.binaryDirectory.isBlank()) dataDir(url)
70
- else withHost(Path .of(expand(state.binaryDirectory)).toAbsolutePath() , url)
71
- return dir.resolve(binaryName)
70
+ else withHost(Path .of(expand(state.binaryDirectory)), url)
71
+ return dir.resolve(binaryName).toAbsolutePath()
72
72
}
73
73
74
74
/* *
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ internal class CoderSettingsTest {
19
19
val url = URL (" http://localhost" )
20
20
val home = Path .of(System .getProperty(" user.home" ))
21
21
22
- state.binaryDirectory = " ~/coder-gateway-test/expand-bin-dir"
22
+ state.binaryDirectory = Path .of( " ~/coder-gateway-test/expand-bin-dir" ).toString()
23
23
var expected = home.resolve(" coder-gateway-test/expand-bin-dir/localhost" )
24
24
assertEquals(expected.toAbsolutePath(), settings.binPath(url).parent)
25
25
26
- state.dataDirectory = " ~/coder-gateway-test/expand-data-dir"
26
+ state.dataDirectory = Path .of( " ~/coder-gateway-test/expand-data-dir" ).toString()
27
27
expected = home.resolve(" coder-gateway-test/expand-data-dir/localhost" )
28
28
assertEquals(expected.toAbsolutePath(), settings.dataDir(url))
29
29
}
You can’t perform that action at this time.
0 commit comments