config/module: don't walk dst when dst is in src

Fixes #518
This commit is contained in:
Emil Hessman 2014-11-04 21:27:12 +01:00
parent 82e4bab178
commit a76290f278

View File

@ -39,6 +39,11 @@ func copyDir(dst, src string) error {
// If we have a directory, make that subdirectory, then continue // If we have a directory, make that subdirectory, then continue
// the walk. // the walk.
if info.IsDir() { if info.IsDir() {
if path == filepath.Join(src, dst) {
// dst is in src; don't walk it.
return nil
}
if err := os.MkdirAll(dstPath, 0755); err != nil { if err := os.MkdirAll(dstPath, 0755); err != nil {
return err return err
} }