(src, dst string)
| 14 | ) |
| 15 | |
| 16 | func 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 | |
| 30 | func ClearDir(dir string) error { |
| 31 | // if the dir doesn't exist, use default filemode 0755 to create it |
no test coverage detected