(src string, dest string, ignoreFns ...IgnoreFn)
| 938 | } |
| 939 | |
| 940 | func CopyDirOverwrite(src string, dest string, ignoreFns ...IgnoreFn) error { |
| 941 | srcRelFilePaths, err := ListDirRecursive(src, true, ignoreFns...) |
| 942 | if err != nil { |
| 943 | return err |
| 944 | } |
| 945 | |
| 946 | if _, err := CreateDirIfMissing(dest); err != nil { |
| 947 | return err |
| 948 | } |
| 949 | createdDirs := strset.New(dest) |
| 950 | |
| 951 | for _, srcRelFilePath := range srcRelFilePaths { |
| 952 | srcFilePath := filepath.Join(src, srcRelFilePath) |
| 953 | destFilePath := filepath.Join(dest, srcRelFilePath) |
| 954 | |
| 955 | destFileDir := filepath.Dir(destFilePath) |
| 956 | if !createdDirs.Has(destFileDir) { |
| 957 | if _, err := CreateDirIfMissing(destFileDir); err != nil { |
| 958 | return err |
| 959 | } |
| 960 | createdDirs.Add(destFileDir) |
| 961 | } |
| 962 | |
| 963 | if err := CopyFileOverwrite(srcFilePath, destFilePath); err != nil { |
| 964 | return err |
| 965 | } |
| 966 | } |
| 967 | |
| 968 | return nil |
| 969 | } |
| 970 | |
| 971 | func CopyRecursiveShell(src string, dest string) error { |
| 972 | cleanSrc, err := EscapeTilde(src) |
nothing calls this directly
no test coverage detected