MCPcopy Index your code
hub / github.com/devcontainers/cli / lifecycleCommandOriginMapFromMetadata

Function lifecycleCommandOriginMapFromMetadata

src/spec-node/imageMetadata.ts:124–144  ·  view source on GitHub ↗
(metadata: ImageMetadataEntry[])

Source from the content-addressed store, hash-verified

122}
123
124export function lifecycleCommandOriginMapFromMetadata(metadata: ImageMetadataEntry[]): LifecycleHooksInstallMap {
125 const map: LifecycleHooksInstallMap = {
126 onCreateCommand: [],
127 updateContentCommand: [],
128 postCreateCommand: [],
129 postStartCommand: [],
130 postAttachCommand: [],
131 initializeCommand: []
132 };
133 for (const entry of metadata) {
134 const id = entry.id; // Only Features have IDs encoded in the metadata.
135 const origin = id ?? 'devcontainer.json';
136 for (const hook of pickFeatureLifecycleHookProperties) {
137 const command = entry[hook];
138 if (command) {
139 map[hook].push({ origin, command });
140 }
141 }
142 }
143 return map;
144}
145
146function mergeLifecycleHooks(metadata: ImageMetadataEntry[], hook: (keyof SchemaFeatureLifecycleHooks)): LifecycleCommand[] | undefined {
147 const collected: LifecycleCommand[] = [];

Callers 4

setupContainerFunction · 0.90
doSetUpFunction · 0.90
doRunUserCommandsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected