[WIP] Fix uninstaller deletion bug.

This commit is contained in:
Vladimir Stoilov
2024-09-30 11:33:21 +03:00
parent f0272766c1
commit 97ce3c087c
2 changed files with 19 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
package updates
import (
"errors"
"fmt"
"runtime"
"time"
@@ -22,10 +23,14 @@ const (
ResourceUpdateEvent = "resource update"
)
// UserAgent is an HTTP User-Agent that is used to add
// more context to requests made by the registry when
// fetching resources from the update server.
var UserAgent = fmt.Sprintf("Portmaster (%s %s)", runtime.GOOS, runtime.GOARCH)
var (
// UserAgent is an HTTP User-Agent that is used to add
// more context to requests made by the registry when
// fetching resources from the update server.
UserAgent = fmt.Sprintf("Portmaster (%s %s)", runtime.GOOS, runtime.GOARCH)
ErrNotFound error = errors.New("file not found")
)
// UpdateIndex holds the configuration for the updates module.
type UpdateIndex struct {
@@ -193,7 +198,7 @@ func (u *Updates) GetRootPath() string {
return u.registry.dir
}
// GetFile returns the path of a file given the name.
// GetFile returns the path of a file given the name. Returns ErrNotFound if file is not found.
func (u *Updates) GetFile(id string) (*File, error) {
file, ok := u.registry.files[id]
if ok {