Skip to content

Commit 72512e3

Browse files
committed
prevent unintended early return from skipping writing wildcard configs
1 parent cdc6fda commit 72512e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ class CoderCLIManager(
257257
val host = deploymentURL.safeHost()
258258
val startBlock = "# --- START CODER JETBRAINS $host"
259259
val endBlock = "# --- END CODER JETBRAINS $host"
260-
val isRemoving = workspaceNames.isEmpty()
261260
val baseArgs =
262261
listOfNotNull(
263262
escape(localBinaryPath.toString()),
@@ -346,6 +345,8 @@ class CoderCLIManager(
346345
val start = "(\\s*)$startBlock".toRegex().find(contents)
347346
val end = "$endBlock(\\s*)".toRegex().find(contents)
348347

348+
val isRemoving = blockContent.isEmpty()
349+
349350
if (start == null && end == null && isRemoving) {
350351
logger.info("No workspaces and no existing config blocks to remove")
351352
return null

0 commit comments

Comments
 (0)