mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-06-16 05:55:33 +00:00
update file task
This commit is contained in:
parent
fa62c65526
commit
9e5381710f
@ -102,16 +102,20 @@ func FileOperate(k string) {
|
|||||||
os.RemoveAll(temp.To + "/" + lastPath)
|
os.RemoveAll(temp.To + "/" + lastPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err := os.Rename(v.From, temp.To+"/"+lastPath)
|
err := file.CopyDir(v.From, temp.To, temp.Style)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
logger.Error("file move error", zap.Any("err", err))
|
err = os.RemoveAll(v.From)
|
||||||
err = file.MoveFile(v.From, temp.To+"/"+lastPath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("MoveFile error", zap.Any("err", err))
|
logger.Error("file move error", zap.Any("err", err))
|
||||||
continue
|
err = file.MoveFile(v.From, temp.To+"/"+lastPath)
|
||||||
}
|
if err != nil {
|
||||||
|
logger.Error("MoveFile error", zap.Any("err", err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if temp.Type == "copy" {
|
} else if temp.Type == "copy" {
|
||||||
err := file.CopyDir(v.From, temp.To, temp.Style)
|
err := file.CopyDir(v.From, temp.To, temp.Style)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user