MCPcopy
hub / github.com/loft-sh/devpod / PatchEtcProfile

Function PatchEtcProfile

pkg/devcontainer/setup/setup.go:170–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168}
169
170func PatchEtcProfile() error {
171 exists, err := markerFileExists("patchEtcProfile", "")
172 if err != nil {
173 return err
174 } else if exists {
175 return nil
176 }
177
178 out, err := exec.Command("sh", "-c", `sed -i -E 's/((^|\s)PATH=)([^\$]*)$/\1${PATH:-\3}/g' /etc/profile || true`).CombinedOutput()
179 if err != nil {
180 return errors.Wrapf(err, "create remote environment: %v", string(out))
181 }
182
183 return nil
184}
185
186func PatchEtcEnvironmentFlags(workspaceEnv []string, log log.Logger) error {
187 if len(workspaceEnv) == 0 {

Callers 1

SetupContainerFunction · 0.85

Calls 2

markerFileExistsFunction · 0.85
CommandMethod · 0.65

Tested by

no test coverage detected