Skip to content

Commit 9f096cf

Browse files
committed
impl: uri support for specifying a project to open
- it's optional - `project_path` is the query param
1 parent b67585f commit 9f096cf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ open class CoderProtocolHandler(
156156
context.envPageManager.showEnvironmentPage(environmentId, false)
157157
val productCode = params.ideProductCode()
158158
val buildNumber = params.ideBuildNumber()
159+
val projectPath = params.projectPath()
159160
if (!productCode.isNullOrBlank() && !buildNumber.isNullOrBlank()) {
160161
context.cs.launch {
161162
val ideVersion = "$productCode-$buildNumber"
@@ -165,7 +166,7 @@ open class CoderProtocolHandler(
165166
}
166167
job.join()
167168
context.logger.info("launching $ideVersion on $environmentId")
168-
context.ideOrchestrator.connectToIde(environmentId, ideVersion, null)
169+
context.ideOrchestrator.connectToIde(environmentId, ideVersion, projectPath)
169170
}
170171
}
171172
}

src/main/kotlin/com/coder/toolbox/util/LinkMap.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private const val FOLDER = "folder"
1111
private const val IDE_DOWNLOAD_LINK = "ide_download_link"
1212
private const val IDE_PRODUCT_CODE = "ide_product_code"
1313
private const val IDE_BUILD_NUMBER = "ide_build_number"
14-
private const val IDE_PATH_ON_HOST = "ide_path_on_host"
14+
private const val IDE_PATH_ON_HOST = "project_path"
1515

1616
// Helper functions for reading from the map. Prefer these to directly
1717
// interacting with the map.
@@ -34,4 +34,4 @@ fun Map<String, String>.ideProductCode() = this[IDE_PRODUCT_CODE]
3434

3535
fun Map<String, String>.ideBuildNumber() = this[IDE_BUILD_NUMBER]
3636

37-
fun Map<String, String>.idePathOnHost() = this[IDE_PATH_ON_HOST]
37+
fun Map<String, String>.projectPath() = this[IDE_PATH_ON_HOST]

0 commit comments

Comments
 (0)