feat: file copy, move and paste conflict checking

This commit is contained in:
Ramires Viana committed 2020-07-17 12:37:52 +00:00
1 parent 9a2ebbabe2
commit eed9da1471
8 files changed
+138 -51

No files matched your search

+2 -1
View File
@@ -2,6 +2,7 @@ package fileutils
import (
"io"
"os"
"path/filepath"
"github.com/spf13/afero"
@@ -25,7 +26,7 @@ func CopyFile(fs afero.Fs, source, dest string) error {
}
// Create the destination file.
dst, err := fs.Create(dest)
dst, err := fs.OpenFile(dest, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0775)
if err != nil {
return err
}