refactor: reverting changes no longer needed
This commit is contained in:
parent
274dfd244d
commit
bddf17ba4e
@ -6,7 +6,10 @@ import (
|
|||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateDir(fs afero.Fs, source, dest string) error {
|
// CopyDir copies a directory from source to dest and all
|
||||||
|
// of its sub-directories. It doesn't stop if it finds an error
|
||||||
|
// during the copy. Returns an error if any.
|
||||||
|
func CopyDir(fs afero.Fs, source, dest string) error {
|
||||||
// Get properties of source.
|
// Get properties of source.
|
||||||
srcinfo, err := fs.Stat(source)
|
srcinfo, err := fs.Stat(source)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -19,18 +22,6 @@ func CreateDir(fs afero.Fs, source, dest string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// CopyDir copies a directory from source to dest and all
|
|
||||||
// of its sub-directories. It doesn't stop if it finds an error
|
|
||||||
// during the copy. Returns an error if any.
|
|
||||||
func CopyDir(fs afero.Fs, source, dest string) error {
|
|
||||||
err := CreateDir(fs, source, dest)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
dir, _ := fs.Open(source)
|
dir, _ := fs.Open(source)
|
||||||
obs, err := dir.Readdir(-1)
|
obs, err := dir.Readdir(-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user