()
| 168 | } |
| 169 | |
| 170 | func 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 | |
| 186 | func PatchEtcEnvironmentFlags(workspaceEnv []string, log log.Logger) error { |
| 187 | if len(workspaceEnv) == 0 { |
no test coverage detected