🎨 Improve file copy

This commit is contained in:
Daniel 2023-06-15 09:41:42 +08:00
parent d12b39c3c2
commit e93c62e49f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 13 additions and 7 deletions

View file

@ -383,7 +383,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
return nil
})
if err = filelock.RoboCopy(unzipRootPath, targetDir); nil != err {
if err = filelock.Copy(unzipRootPath, targetDir); nil != err {
logging.LogErrorf("copy data dir from [%s] to [%s] failed: %s", unzipRootPath, util.DataDir, err)
err = errors.New("copy data failed")
return
@ -440,7 +440,7 @@ func ImportData(zipPath string) (err error) {
}
tmpDataPath := filepath.Join(unzipPath, dirs[0].Name())
if err = filelock.RoboCopy(tmpDataPath, util.DataDir); nil != err {
if err = filelock.Copy(tmpDataPath, util.DataDir); nil != err {
logging.LogErrorf("copy data dir from [%s] to [%s] failed: %s", tmpDataPath, util.DataDir, err)
err = errors.New("copy data failed")
return