mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🐛 Uninstalling plugins, widgets and templates may cause data sync errors https://github.com/siyuan-note/siyuan/issues/10324
This commit is contained in:
parent
fe9e261feb
commit
745c9bcf99
7 changed files with 14 additions and 12 deletions
|
@ -27,6 +27,7 @@ import (
|
|||
|
||||
"github.com/dustin/go-humanize"
|
||||
ants "github.com/panjf2000/ants/v2"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/httpclient"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
@ -214,7 +215,7 @@ func InstallPlugin(repoURL, repoHash, installPath string, systemID string) error
|
|||
}
|
||||
|
||||
func UninstallPlugin(installPath string) error {
|
||||
if err := os.RemoveAll(installPath); nil != err {
|
||||
if err := filelock.Remove(installPath); nil != err {
|
||||
logging.LogErrorf("remove plugin [%s] failed: %s", installPath, err)
|
||||
return errors.New("remove community plugin failed")
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import (
|
|||
|
||||
"github.com/dustin/go-humanize"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/httpclient"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
@ -176,7 +177,7 @@ func InstallTemplate(repoURL, repoHash, installPath string, systemID string) err
|
|||
}
|
||||
|
||||
func UninstallTemplate(installPath string) error {
|
||||
if err := os.RemoveAll(installPath); nil != err {
|
||||
if err := filelock.Remove(installPath); nil != err {
|
||||
logging.LogErrorf("remove template [%s] failed: %s", installPath, err)
|
||||
return errors.New("remove community template failed")
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import (
|
|||
|
||||
"github.com/dustin/go-humanize"
|
||||
ants "github.com/panjf2000/ants/v2"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/httpclient"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
@ -174,7 +175,7 @@ func InstallWidget(repoURL, repoHash, installPath string, systemID string) error
|
|||
}
|
||||
|
||||
func UninstallWidget(installPath string) error {
|
||||
if err := os.RemoveAll(installPath); nil != err {
|
||||
if err := filelock.Remove(installPath); nil != err {
|
||||
logging.LogErrorf("remove widget [%s] failed: %s", installPath, err)
|
||||
return errors.New("remove community widget failed")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue