This commit is contained in:
parent
14c023477c
commit
ba329cb252
1 changed files with 5 additions and 5 deletions
|
@ -468,6 +468,11 @@ func RenameAsset(oldPath, newName string) (err error) {
|
|||
}
|
||||
|
||||
newPath := util.AssetName(newName)
|
||||
if err = gulu.File.Copy(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err {
|
||||
util.LogErrorf("copy asset [%s] failed: %s", oldPath, err)
|
||||
return
|
||||
}
|
||||
|
||||
luteEngine := NewLute()
|
||||
for _, notebook := range notebooks {
|
||||
pages := pagedPaths(filepath.Join(util.DataDir, notebook.ID), 32)
|
||||
|
@ -506,11 +511,6 @@ func RenameAsset(oldPath, newName string) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
if err = os.Rename(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err {
|
||||
util.LogErrorf("rename asset [%s] failed: %s", oldPath, err)
|
||||
return
|
||||
}
|
||||
|
||||
IncSync()
|
||||
|
||||
util.PushEndlessProgress(Conf.Language(113))
|
||||
|
|
Loading…
Add table
Reference in a new issue