🎨 改进写入工作空间路径配置

This commit is contained in:
Liang Ding 2023-03-23 19:32:11 +08:00
parent 68192aaff6
commit 4bb39d90fe
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -35,6 +35,7 @@ import (
"github.com/88250/gulu"
figure "github.com/common-nighthawk/go-figure"
"github.com/gofrs/flock"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/httpclient"
"github.com/siyuan-note/logging"
)
@ -295,7 +296,7 @@ func WriteWorkspacePaths(workspacePaths []string) (err error) {
return
}
if err = os.WriteFile(workspaceConf, data, 0644); nil != err {
if err = filelock.WriteFile(workspaceConf, data); nil != err {
msg := fmt.Sprintf("write workspace conf [%s] failed: %s", workspaceConf, err)
logging.LogErrorf(msg)
err = errors.New(msg)