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

Function extractDirectives

src/spec-node/dockerfileUtils.ts:122–135  ·  view source on GitHub ↗
(preambleStr: string)

Source from the content-addressed store, hash-verified

120}
121
122function extractDirectives(preambleStr: string) {
123 const map: Record<string, string> = {};
124 for (const line of preambleStr.split(/\r?\n/)) {
125 const groups = line.match(directives)?.groups;
126 if (groups) {
127 if (!map[groups.name]) {
128 map[groups.name] = groups.value;
129 }
130 } else {
131 break;
132 }
133 }
134 return map;
135}
136
137function extractInstructions(stageStr: string) {
138 return [...stageStr.matchAll(argEnvUserStatements)]

Callers 1

extractDockerfileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected