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(
4040 */
4141 fun dataDir (url : URL ): Path {
4242 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()
4545 }
4646
4747 /* *
@@ -67,8 +67,8 @@ open class CoderSettings(
6767 fun binPath (url : URL , forceDownloadToData : Boolean = false): Path {
6868 val binaryName = getCoderCLIForOS(getOS(), getArch())
6969 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()
7272 }
7373
7474 /* *
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ internal class CoderSettingsTest {
1919 val url = URL (" http://localhost" )
2020 val home = Path .of(System .getProperty(" user.home" ))
2121
22- state.binaryDirectory = " ~/coder-gateway-test/expand-bin-dir"
22+ state.binaryDirectory = Path .of( " ~/coder-gateway-test/expand-bin-dir" ).toString()
2323 var expected = home.resolve(" coder-gateway-test/expand-bin-dir/localhost" )
2424 assertEquals(expected.toAbsolutePath(), settings.binPath(url).parent)
2525
26- state.dataDirectory = " ~/coder-gateway-test/expand-data-dir"
26+ state.dataDirectory = Path .of( " ~/coder-gateway-test/expand-data-dir" ).toString()
2727 expected = home.resolve(" coder-gateway-test/expand-data-dir/localhost" )
2828 assertEquals(expected.toAbsolutePath(), settings.dataDir(url))
2929 }
You can’t perform that action at this time.
0 commit comments