Commit ac49e6e
docs(claude-code): document pre_install_script for module dependency ordering (#613)
## 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
```hcl
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.
Co-authored-by: Jason Barnett <Jason.Barnett@altana.ai>
Co-authored-by: DevCats <christofer@coder.com>1 parent 63e28c0 commit ac49e6e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments