This commit is contained in:
Daniel 2024-04-14 23:52:09 +08:00
parent 16c665bfa7
commit afeea6a80e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
7 changed files with 42 additions and 61 deletions

View file

@ -17,7 +17,6 @@
package bazaar
import (
"errors"
"os"
"path/filepath"
"runtime"
@ -27,7 +26,6 @@ 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"
@ -220,16 +218,11 @@ func InstallPlugin(repoURL, repoHash, installPath string, systemID string) error
if nil != err {
return err
}
return installPackage(data, installPath)
return installPackage(data, installPath, repoURLHash)
}
func UninstallPlugin(installPath string) error {
if err := filelock.Remove(installPath); nil != err {
logging.LogErrorf("remove plugin [%s] failed: %s", installPath, err)
return errors.New("remove community plugin failed")
}
//logging.Logger.Infof("uninstalled plugin [%s]", installPath)
return nil
return uninstallPackage(installPath)
}
func isIncompatiblePlugin(plugin *Plugin, currentFrontend string) bool {