You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(registry/coder/modules/coder-utils): return scripts as a keyed map
Keying by phase lets callers write `module.coder_utils.scripts.install`
instead of indexing a list whose length depends on which optional
scripts were configured. Unconfigured phases are `null`. Callers that
want every configured name can use `compact(values(scripts))`.
README documents both patterns.
Copy file name to clipboardExpand all lines: registry/coder/modules/coder-utils/README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,3 +99,24 @@ The module materializes each script to `${module_directory}/scripts/` before run
99
99
-`start.sh`
100
100
101
101
The pre-install and install `coder_script`s `mkdir -p` this subdirectory; post-install and start sync-depend on install, so the directory already exists by the time they run.
102
+
103
+
## Chaining downstream scripts
104
+
105
+
The `scripts` output exposes the `coder exp sync` name for each phase keyed by phase, with `null` for phases that were not configured. Downstream modules can sync their own `coder_script` resources behind this pipeline:
description="Ordered list of `coder exp sync` names for the coder_script resources this module creates, in the run order it enforces (pre_install, install, post_install, start). Scripts that were not configured are absent from the list."
0 commit comments