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

Function checkForPersistedFile

src/spec-node/dockerCompose.ts:307–333  ·  view source on GitHub ↗
(cliHost: CLIHost, output: Log, files: string[], prefix: string)

Source from the content-addressed store, hash-verified

305}
306
307async function checkForPersistedFile(cliHost: CLIHost, output: Log, files: string[], prefix: string) {
308 const file = files.find((f) => f.indexOf(prefix) > -1);
309 if (file) {
310 const composeFileExists = await cliHost.isFile(file);
311
312 if (composeFileExists) {
313 output.write(`Restoring ${file} from persisted storage`);
314 return {
315 foundLabel: true,
316 fileExists: true,
317 file
318 };
319 } else {
320 output.write(`Expected ${file} to exist, but it did not`, LogLevel.Error);
321 return {
322 foundLabel: true,
323 fileExists: false,
324 file
325 };
326 }
327 } else {
328 output.write(`Expected to find a docker-compose file prefixed with ${prefix}, but did not.`, LogLevel.Error);
329 }
330 return {
331 foundLabel: false
332 };
333}
334
335async function startContainer(params: DockerResolverParameters, buildParams: DockerCLIParameters, configWithRaw: SubstitutedConfig<DevContainerFromDockerComposeConfig>, projectName: string, composeFiles: string[], envFile: string | undefined, composeConfig: any, container: ContainerDetails | undefined, idLabels: string[], additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>) {
336 const { common } = params;

Callers 1

startContainerFunction · 0.85

Calls 2

isFileMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected