Skip to content

Commit ca68ef3

Browse files
authored
Use expanded directory if available (#227)
The JetBrains remote does not expand them so you get errors like "~/coder does not exist".
1 parent 518f54d commit ca68ef3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/kotlin/com/coder/gateway/sdk/v2/models/WorkspaceAgent.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ data class WorkspaceAgent(
2020
@SerializedName("operating_system") val operatingSystem: String,
2121
@SerializedName("startup_script") val startupScript: String?,
2222
@SerializedName("directory") val directory: String?,
23+
@SerializedName("expanded_directory") val expandedDirectory: String?,
2324
@SerializedName("version") val version: String,
2425
@SerializedName("apps") val apps: List<WorkspaceApp>,
2526
@SerializedName("latency") val derpLatency: Map<String, DERPRegion>?,
2627
@SerializedName("connection_timeout_seconds") val connectionTimeoutSeconds: Int,
27-
@SerializedName("troubleshooting_url") val troubleshootingURL: String
28+
@SerializedName("troubleshooting_url") val troubleshootingURL: String,
2829
)
2930

3031
enum class WorkspaceAgentStatus {
@@ -44,4 +45,4 @@ enum class WorkspaceAgentStatus {
4445
data class DERPRegion(
4546
@SerializedName("preferred") val preferred: Boolean,
4647
@SerializedName("latency_ms") val latencyMillis: Double
47-
)
48+
)

src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ class CoderWorkspacesStepView(val setNextButtonEnabled: (Boolean) -> Unit) : Cod
655655
this.latestBuild.transition,
656656
OS.from(agent.operatingSystem),
657657
Arch.from(agent.architecture),
658-
agent.directory
658+
agent.expandedDirectory ?: agent.directory,
659659
)
660660
cs.launch(Dispatchers.IO) {
661661
wm.templateIcon = iconDownloader.load(wm.templateIconPath, wm.name)

0 commit comments

Comments
 (0)