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

Function doProvision

src/spec-node/devContainersSpecCLI.ts:320–352  ·  view source on GitHub ↗
(options: ProvisionOptions, providedIdLabels: string[] | undefined)

Source from the content-addressed store, hash-verified

318}
319
320async function doProvision(options: ProvisionOptions, providedIdLabels: string[] | undefined) {
321 const disposables: (() => Promise<unknown> | undefined)[] = [];
322 const dispose = async () => {
323 await Promise.all(disposables.map(d => d()));
324 };
325 try {
326 const result = await launch(options, providedIdLabels, disposables);
327 return {
328 outcome: 'success' as 'success',
329 dispose,
330 ...result,
331 };
332 } catch (originalError) {
333 const originalStack = originalError?.stack;
334 const err = originalError instanceof ContainerError ? originalError : new ContainerError({
335 description: 'An error occurred setting up the container.',
336 originalError
337 });
338 if (originalStack) {
339 console.error(originalStack);
340 }
341 return {
342 outcome: 'error' as 'error',
343 message: err.message,
344 description: err.description,
345 containerId: err.containerId,
346 disallowedFeatureId: err.data.disallowedFeatureId,
347 didStopContainer: err.data.didStopContainer,
348 learnMoreUrl: err.data.learnMoreUrl,
349 dispose,
350 };
351 }
352}
353
354function setUpOptions(y: Argv) {
355 return y.options({

Callers 1

provisionFunction · 0.85

Calls 1

launchFunction · 0.90

Tested by

no test coverage detected