Skip to content

Commit c45bb60

Browse files
authored
fix: Fix file copy overwrite error (1Panel-dev#9796)
1 parent fba46be commit c45bb60

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

agent/app/service/file.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,14 @@ func (f *FileService) MvFile(m request.FileMove) error {
417417
global.LOG.Errorf("copy file [%s] to [%s] failed, err: %s", src, m.NewPath, err.Error())
418418
}
419419
}
420+
if len(m.CoverPaths) > 0 {
421+
for _, src := range m.CoverPaths {
422+
if err := fo.CopyAndReName(src, m.NewPath, "", true); err != nil {
423+
errs = append(errs, err)
424+
global.LOG.Errorf("copy file [%s] to [%s] failed, err: %s", src, m.NewPath, err.Error())
425+
}
426+
}
427+
}
420428
}
421429

422430
var errString string

0 commit comments

Comments
 (0)