Skip to content

Conversation

@jasonwbarnett
Copy link

Summary

Clarifies that the existing pre_install_script variable can be used to handle dependencies between modules during workspace startup.

Problem

When using multiple startup modules (e.g., git-clone and claude-code), there's a race condition where scripts execute in parallel. Module dependencies need to be managed, such as ensuring git-clone completes before Claude Code tries to access a workdir.

Solution

The existing pre_install_script variable already provides this capability. Updated documentation to clarify this use case.

Example

module "claude-code" {
  source = "registry.coder.com/coder/claude-code/coder"
  
  workdir = "/path/to/repo"
  
  # Wait for git-clone to complete before starting
  pre_install_script = <<-EOT
    #!/bin/bash
    set -e
    while [ ! -f /tmp/.git-clone-complete ]; do
      sleep 1
    done
  EOT
}

Resolves issue #609.

…ordering

Update the pre_install_script variable description to clarify that it can be
used for handling dependencies between modules, such as waiting for git-clone
to complete before Claude Code initialization.
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.

1 participant