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

Function config

src/spec-configuration/containerTemplatesOCI.ts:102–116  ·  view source on GitHub ↗
(files: string[])

Source from the content-addressed store, hash-verified

100
101 // Get the config. A template should not have more than one devcontainer.json.
102 const config = async (files: string[]) => {
103 const p = files.find(f => f.endsWith('devcontainer.json'));
104 if (p) {
105 const configPath = path.join(templateDestPath, p);
106 if (await isLocalFile(configPath)) {
107 const configContents = await readLocalFile(configPath);
108 return {
109 configPath,
110 configText: configContents.toString(),
111 configObject: jsonc.parse(configContents.toString()) as DevContainerConfig,
112 };
113 }
114 }
115 return undefined;
116 };
117
118 if (selectedTemplate.features.length !== 0) {
119 const configResult = await config(files);

Callers 1

fetchTemplateFunction · 0.85

Calls 1

isLocalFileFunction · 0.90

Tested by

no test coverage detected