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

Function patchEtcEnvironment

src/spec-common/injectHeadless.ts:750–761  ·  view source on GitHub ↗
(params: ResolverParameters, containerProperties: ContainerProperties)

Source from the content-addressed store, hash-verified

748}
749
750async function patchEtcEnvironment(params: ResolverParameters, containerProperties: ContainerProperties) {
751 const markerFile = path.posix.join(getSystemVarFolder(params), `.patchEtcEnvironmentMarker`);
752 if (params.allowSystemConfigChange && containerProperties.launchRootShellServer && !(await isFile(containerProperties.shellServer, markerFile))) {
753 const rootShellServer = await containerProperties.launchRootShellServer();
754 if (await createFile(rootShellServer, markerFile)) {
755 await rootShellServer.exec(`cat >> /etc/environment <<'etcEnvironmentEOF'
756${Object.keys(containerProperties.env).map(k => `\n${k}="${containerProperties.env[k]}"`).join('')}
757etcEnvironmentEOF
758`);
759 }
760 }
761}
762
763async function patchEtcProfile(params: ResolverParameters, containerProperties: ContainerProperties) {
764 const markerFile = path.posix.join(getSystemVarFolder(params), `.patchEtcProfileMarker`);

Callers 1

setupInContainerFunction · 0.85

Calls 4

isFileFunction · 0.90
getSystemVarFolderFunction · 0.85
createFileFunction · 0.85
execMethod · 0.65

Tested by

no test coverage detected