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

Function parseFromStatement

src/spec-node/dockerfileUtils.ts:46–54  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

44}
45
46function parseFromStatement(line: string): From {
47 const match = fromStatement.exec(line);
48 if (!match) {
49 return { image: 'unknown' };
50 }
51 let { platform, image, label } = match.groups as unknown as From;
52 image = image.replace(/^['"]|['"]$/g, ''); // remove quotes
53 return { platform, image, label };
54}
55
56export function extractDockerfile(dockerfile: string): Dockerfile {
57 const fromStatementsAhead = /(?=^[\t ]*FROM)/gmi;

Callers 1

extractDockerfileFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected