MCPcopy Create free account
hub / github.com/jetify-com/devbox / CopyAll

Function CopyAll

internal/fileutil/dir.go:16–28  ·  view source on GitHub ↗
(src, dst string)

Source from the content-addressed store, hash-verified

14)
15
16func CopyAll(src, dst string) error {
17 entries, err := os.ReadDir(src)
18 if err != nil {
19 return errors.WithStack(err)
20 }
21 for _, entry := range entries {
22 cmd := cmdutil.CommandTTY("cp", "-rf", filepath.Join(src, entry.Name()), dst)
23 if err := cmd.Run(); err != nil {
24 return errors.WithStack(err)
25 }
26 }
27 return nil
28}
29
30func ClearDir(dir string) error {
31 // if the dir doesn't exist, use default filemode 0755 to create it

Callers 1

PushFunction · 0.92

Calls 2

CommandTTYFunction · 0.92
RunMethod · 0.65

Tested by

no test coverage detected