chore: Remove obsolete Container.UpdateFromPath (#1631)

* chore: Remove obsolete Container.UpdateFromPath

* remove unused import
This commit is contained in:
ChristopherHX
2023-02-16 17:11:26 +01:00
committed by GitHub
parent 1316307313
commit 21ea3d0d5f
4 changed files with 0 additions and 63 deletions

View File

@@ -2,7 +2,6 @@ package container
import (
"archive/tar"
"bufio"
"bytes"
"context"
"errors"
@@ -344,32 +343,6 @@ func (e *HostEnvironment) UpdateFromEnv(srcPath string, env *map[string]string)
return parseEnvFile(e, srcPath, env)
}
func (e *HostEnvironment) UpdateFromPath(env *map[string]string) common.Executor {
localEnv := *env
return func(ctx context.Context) error {
pathTar, err := e.GetContainerArchive(ctx, localEnv["GITHUB_PATH"])
if err != nil {
return err
}
defer pathTar.Close()
reader := tar.NewReader(pathTar)
_, err = reader.Next()
if err != nil && err != io.EOF {
return err
}
s := bufio.NewScanner(reader)
for s.Scan() {
line := s.Text()
pathSep := string(filepath.ListSeparator)
localEnv[e.GetPathVariableName()] = fmt.Sprintf("%s%s%s", line, pathSep, localEnv[e.GetPathVariableName()])
}
env = &localEnv
return nil
}
}
func (e *HostEnvironment) Remove() common.Executor {
return func(ctx context.Context) error {
if e.CleanUp != nil {