]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
common/hugio: Fix CopyDir when fs is not OS
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 13 Aug 2022 16:26:16 +0000 (18:26 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 13 Aug 2022 16:26:16 +0000 (18:26 +0200)
common/hugio/copy.go

index 7c52f872346f3cb2a2b7e1eae7e84abc8109d32d..cd2eac0365de46cc71fcd27cac9d90658ed4af8c 100644 (file)
@@ -17,7 +17,6 @@ import (
        "fmt"
        "io"
        "io/ioutil"
-       "os"
        "path/filepath"
 
        "github.com/spf13/afero"
@@ -53,7 +52,7 @@ func CopyFile(fs afero.Fs, from, to string) error {
 
 // CopyDir copies a directory.
 func CopyDir(fs afero.Fs, from, to string, shouldCopy func(filename string) bool) error {
-       fi, err := os.Stat(from)
+       fi, err := fs.Stat(from)
        if err != nil {
                return err
        }