MCPcopy
hub / github.com/nektos/act / Copy

Method Copy

pkg/container/host_environment.go:50–62  ·  view source on GitHub ↗
(destPath string, files ...*FileEntry)

Source from the content-addressed store, hash-verified

48}
49
50func (e *HostEnvironment) Copy(destPath string, files ...*FileEntry) common.Executor {
51 return func(_ context.Context) error {
52 for _, f := range files {
53 if err := os.MkdirAll(filepath.Dir(filepath.Join(destPath, f.Name)), 0o777); err != nil {
54 return err
55 }
56 if err := os.WriteFile(filepath.Join(destPath, f.Name), []byte(f.Body), fs.FileMode(f.Mode)); err != nil {
57 return err
58 }
59 }
60 return nil
61 }
62}
63
64func (e *HostEnvironment) CopyTarStream(ctx context.Context, destPath string, tarStream io.Reader) error {
65 if err := os.RemoveAll(destPath); err != nil {

Callers

nothing calls this directly

Calls 1

WriteFileMethod · 0.65

Tested by

no test coverage detected