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

Function getFeatureEnvVariables

src/spec-node/containerFeatures.ts:393–419  ·  view source on GitHub ↗
(f: Feature)

Source from the content-addressed store, hash-verified

391
392
393function getFeatureEnvVariables(f: Feature) {
394 const values = getFeatureValueObject(f);
395 const idSafe = getSafeId(f.id);
396 const variables = [];
397
398 if(f.internalVersion !== '2')
399 {
400 if (values) {
401 variables.push(...Object.keys(values)
402 .map(name => `_BUILD_ARG_${idSafe}_${getSafeId(name)}="${values[name]}"`));
403 variables.push(`_BUILD_ARG_${idSafe}=true`);
404 }
405 if (f.buildArg) {
406 variables.push(`${f.buildArg}=${getFeatureMainValue(f)}`);
407 }
408 return variables;
409 } else {
410 if (values) {
411 variables.push(...Object.keys(values)
412 .map(name => `${getSafeId(name)}="${values[name]}"`));
413 }
414 if (f.buildArg) {
415 variables.push(`${f.buildArg}=${getFeatureMainValue(f)}`);
416 }
417 return variables;
418 }
419}
420
421export async function getRemoteUserUIDUpdateDetails(params: DockerResolverParameters, mergedConfig: MergedDevContainerConfig, imageName: string, imageDetails: () => Promise<ImageDetails>, runArgsUser: string | undefined) {
422 const { common } = params;

Callers 1

getFeaturesBuildOptionsFunction · 0.85

Calls 3

getFeatureValueObjectFunction · 0.90
getFeatureMainValueFunction · 0.90
getSafeIdFunction · 0.85

Tested by

no test coverage detected