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"
"sort"
@ -26,7 +25,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"
@ -180,14 +178,9 @@ func InstallWidget(repoURL, repoHash, installPath string, systemID string) error
if nil != err {
return err
}
return installPackage(data, installPath)
return installPackage(data, installPath, repoURLHash)
}
func UninstallWidget(installPath string) error {
if err := filelock.Remove(installPath); nil != err {
logging.LogErrorf("remove widget [%s] failed: %s", installPath, err)
return errors.New("remove community widget failed")
}
//logging.Logger.Infof("uninstalled widget [%s]", installPath)
return nil
return uninstallPackage(installPath)
}