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

Function runLifecycleCommands

src/spec-common/injectHeadless.ts:453–463  ·  view source on GitHub ↗
(params: ResolverParameters, lifecycleCommandOriginMap: LifecycleHooksInstallMap, containerProperties: ContainerProperties, lifecycleHookName: 'onCreateCommand' | 'updateContentCommand' | 'postCreateCommand' | 'postStartCommand' | 'postAttachCommand', remoteEnv: Promise<Record<string, string>>, secrets: Promise<Record<string, string>>, doRun: boolean)

Source from the content-addressed store, hash-verified

451
452
453async function runLifecycleCommands(params: ResolverParameters, lifecycleCommandOriginMap: LifecycleHooksInstallMap, containerProperties: ContainerProperties, lifecycleHookName: 'onCreateCommand' | 'updateContentCommand' | 'postCreateCommand' | 'postStartCommand' | 'postAttachCommand', remoteEnv: Promise<Record<string, string>>, secrets: Promise<Record<string, string>>, doRun: boolean) {
454 const commandsForHook = lifecycleCommandOriginMap[lifecycleHookName];
455 if (commandsForHook.length === 0) {
456 return;
457 }
458
459 for (const { command, origin } of commandsForHook) {
460 const displayOrigin = origin ? (origin === 'devcontainer.json' ? origin : `Feature '${origin}'`) : '???'; /// '???' should never happen.
461 await runLifecycleCommand(params, containerProperties, command, displayOrigin, lifecycleHookName, remoteEnv, secrets, doRun);
462 }
463}
464
465async function runLifecycleCommand({ lifecycleHook }: ResolverParameters, containerProperties: ContainerProperties, userCommand: LifecycleCommand, userCommandOrigin: string, lifecycleHookName: 'onCreateCommand' | 'updateContentCommand' | 'postCreateCommand' | 'postStartCommand' | 'postAttachCommand', remoteEnv: Promise<Record<string, string>>, secrets: Promise<Record<string, string>>, doRun: boolean) {
466 let hasCommand = false;

Callers 3

runPostCreateCommandFunction · 0.85
runPostStartCommandFunction · 0.85
runPostAttachCommandFunction · 0.85

Calls 1

runLifecycleCommandFunction · 0.85

Tested by

no test coverage detected