mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
♻️ Improve copy file stability https://github.com/siyuan-note/siyuan/issues/7837
This commit is contained in:
parent
e2a3aa0ef8
commit
849476b88c
5 changed files with 24 additions and 30 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
|
||||
"github.com/88250/css"
|
||||
"github.com/88250/gulu"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
|
@ -161,7 +162,7 @@ func ReadCustomCSS(themeName string) (ret map[string]map[string]string, err erro
|
|||
custom := filepath.Join(themePath, "custom.css")
|
||||
|
||||
if !gulu.File.IsExist(custom) {
|
||||
if err = gulu.File.CopyFile(theme, custom); nil != err {
|
||||
if err = filelock.Copy(theme, custom); nil != err {
|
||||
logging.LogErrorf("copy theme [%s] to [%s] failed: %s", theme, custom, err)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue