Skip to content

feat(coder-utils): nest scripts under module_directory/scripts#871

Merged
matifali merged 3 commits intomainfrom
matifali/coder-utils-nest-scripts
Apr 23, 2026
Merged

feat(coder-utils): nest scripts under module_directory/scripts#871
matifali merged 3 commits intomainfrom
matifali/coder-utils-nest-scripts

Conversation

@matifali
Copy link
Copy Markdown
Member

@matifali matifali commented Apr 23, 2026

Summary

Move script files from the flat ${module_directory} to a scripts/ subdirectory, and prefix each script's filename with ${agent_name}-utils- so multiple coder-utils instances can safely share a module_directory. Mirrors the layout #870 established for logs/ and aligns with the Module Data Layout standard in AGENTS.md (#869).

Changes

  • Compute local.scripts_directory = "${var.module_directory}/scripts" and use it for every *.sh path.
  • Script filenames are now ${agent_name}-utils-{pre_install,install,post_install,start}.sh so two coder-utils instances don't collide on disk.
  • Pre-install and install coder_scripts mkdir -p the scripts/ sub-path before writing their .sh; post-install and start sync-depend on install, so the directory already exists by the time they run.
  • Update the module_directory description to call out the nested scripts/ and logs/ paths.
  • Add test_scripts_nested_under_module_directory asserting the new paths (including the ${agent_name}-utils- prefix) and the mkdir -p in each script.
  • README: add a "Script file locations" section documenting the new layout.
  • Bump module version to v1.3.0.

Breaking Changes

Consumers reading ${module_directory}/install.sh (and friends) directly must look under ${module_directory}/scripts/${agent_name}-utils-install.sh instead. No in-repo consumers exist today.

Validation

  • terraform fmt -recursive clean
  • terraform validate clean
  • terraform test → 16/16 pass (includes the new test_scripts_nested_under_module_directory)
  • bun test main.test.ts → 5/5 pass
  • prettier --check clean

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

Copy link
Copy Markdown
Collaborator

@35C4n0r 35C4n0r left a comment

Choose a reason for hiding this comment

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

LGTM

@matifali matifali merged commit 22e5749 into main Apr 23, 2026
4 checks passed
@matifali matifali deleted the matifali/coder-utils-nest-scripts branch April 23, 2026 16:47
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