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

Function patchEtcProfile

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

Source from the content-addressed store, hash-verified

761}
762
763async function patchEtcProfile(params: ResolverParameters, containerProperties: ContainerProperties) {
764 const markerFile = path.posix.join(getSystemVarFolder(params), `.patchEtcProfileMarker`);
765 if (params.allowSystemConfigChange && containerProperties.launchRootShellServer && !(await isFile(containerProperties.shellServer, markerFile))) {
766 const rootShellServer = await containerProperties.launchRootShellServer();
767 if (await createFile(rootShellServer, markerFile)) {
768 await rootShellServer.exec(`sed -i -E 's/((^|\\s)PATH=)([^\\$]*)$/\\1\${PATH:-\\3}/g' /etc/profile || true`);
769 }
770 }
771}
772
773async function probeUserEnv(params: { defaultUserEnvProbe: UserEnvProbe; allowSystemConfigChange: boolean; output: Log; containerSessionDataFolder?: string }, containerProperties: { shell: string; remoteExec: ExecFunction; installFolder?: string; env?: NodeJS.ProcessEnv; shellServer?: ShellServer; launchRootShellServer?: (() => Promise<ShellServer>); user?: string }, config?: CommonMergedDevContainerConfig) {
774 let userEnvProbe = getUserEnvProb(config, params);

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