mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve code snippet writing https://github.com/siyuan-note/siyuan/issues/13101
This commit is contained in:
parent
e15247c052
commit
738a53f43e
1 changed files with 4 additions and 0 deletions
|
|
@ -108,6 +108,10 @@ func writeSnippetsConf(snippets []*conf.Snippet) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
confPath := filepath.Join(util.SnippetsPath, "conf.json")
|
confPath := filepath.Join(util.SnippetsPath, "conf.json")
|
||||||
|
oldData, _ := filelock.ReadFile(confPath)
|
||||||
|
if string(oldData) == string(data) {
|
||||||
|
return
|
||||||
|
}
|
||||||
err = filelock.WriteFile(confPath, data)
|
err = filelock.WriteFile(confPath, data)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue