(files: string[])
| 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); |
no test coverage detected