Skip to content

chore(zed): make coder_script conditional on settings input#934

Open
matifali wants to merge 2 commits into
mainfrom
matifali/zed-conditional-settings-script
Open

chore(zed): make coder_script conditional on settings input#934
matifali wants to merge 2 commits into
mainfrom
matifali/zed-conditional-settings-script

Conversation

@matifali

Copy link
Copy Markdown
Member

The coder_script resource for configuring Zed settings was always created, even when no settings were provided. The script handled this at runtime with an early exit check, but it's cleaner to not create the resource at all.

Changes

  • Add count = var.settings != "" ? 1 : 0 to coder_script "zed_settings" so it's only created when settings are provided
  • Remove the redundant empty SETTINGS_B64 runtime check from the shell script
  • Update zed.tftest.hcl to use indexed reference (coder_script.zed_settings[0]) and assert no resource is created when settings is empty
  • Update main.test.ts to verify no coder_script exists in state when settings is empty

This follows the same pattern used in cursor, windsurf, kiro, and antigravity modules.

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑💻

@35C4n0r 35C4n0r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants