summaryrefslogtreecommitdiffstats
path: root/common/hugio/copy.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/hugio/copy.go')
-rw-r--r--common/hugio/copy.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/hugio/copy.go b/common/hugio/copy.go
index 8dbadc48c..31d679dfc 100644
--- a/common/hugio/copy.go
+++ b/common/hugio/copy.go
@@ -16,6 +16,7 @@ package hugio
import (
"fmt"
"io"
+ iofs "io/fs"
"path/filepath"
"github.com/spf13/afero"
@@ -60,12 +61,16 @@ func CopyDir(fs afero.Fs, from, to string, shouldCopy func(filename string) bool
return fmt.Errorf("%q is not a directory", from)
}
- err = fs.MkdirAll(to, 0777) // before umask
+ err = fs.MkdirAll(to, 0o777) // before umask
if err != nil {
return err
}
- entries, _ := afero.ReadDir(fs, from)
+ d, err := fs.Open(from)
+ if err != nil {
+ return err
+ }
+ entries, _ := d.(iofs.ReadDirFile).ReadDir(-1)
for _, entry := range entries {
fromFilename := filepath.Join(from, entry.Name())
toFilename := filepath.Join(to, entry.Name())