Skip to content

prevent unintended early return from skipping writing wildcard configs #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
prevent unintended early return from skipping writing wildcard configs
  • Loading branch information
bcpeinhardt committed Feb 19, 2025
commit 72512e34c096c77665f79cd5a100471e76ab41ad
3 changes: 2 additions & 1 deletion src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class CoderCLIManager(
val host = deploymentURL.safeHost()
val startBlock = "# --- START CODER JETBRAINS $host"
val endBlock = "# --- END CODER JETBRAINS $host"
val isRemoving = workspaceNames.isEmpty()
val baseArgs =
listOfNotNull(
escape(localBinaryPath.toString()),
Expand Down Expand Up @@ -346,6 +345,8 @@ class CoderCLIManager(
val start = "(\\s*)$startBlock".toRegex().find(contents)
val end = "$endBlock(\\s*)".toRegex().find(contents)

val isRemoving = blockContent.isEmpty()

if (start == null && end == null && isRemoving) {
logger.info("No workspaces and no existing config blocks to remove")
return null
Expand Down