mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-15 03:02:07 +03:00
Pull request: 5270-updater-package-url
Merge in DNS/adguard-home from 5270-updater-package-url to master Squashed commit of the following: commit 50ee8edb6270e750ed82b14c174f88922aff86bb Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Dec 28 12:21:24 2022 +0700 updater: package url
This commit is contained in:
parent
e7fc61a997
commit
bbdcc673a2
@ -92,7 +92,11 @@ func (u *Updater) parseVersionResponse(data []byte) (VersionInfo, error) {
|
||||
info.AnnouncementURL = versionJSON["announcement_url"]
|
||||
|
||||
packageURL, ok := u.downloadURL(versionJSON)
|
||||
info.CanAutoUpdate = aghalg.BoolToNullBool(ok && info.NewVersion != u.version)
|
||||
if !ok {
|
||||
return info, fmt.Errorf("version.json: packageURL not found")
|
||||
}
|
||||
|
||||
info.CanAutoUpdate = aghalg.BoolToNullBool(info.NewVersion != u.version)
|
||||
|
||||
u.newVersion = info.NewVersion
|
||||
u.packageURL = packageURL
|
||||
|
@ -174,7 +174,7 @@ func (u *Updater) prepare(exePath string) (err error) {
|
||||
|
||||
_, pkgNameOnly := filepath.Split(u.packageURL)
|
||||
if pkgNameOnly == "" {
|
||||
return fmt.Errorf("invalid PackageURL")
|
||||
return fmt.Errorf("invalid PackageURL: %q", u.packageURL)
|
||||
}
|
||||
|
||||
u.packageName = filepath.Join(u.updateDir, pkgNameOnly)
|
||||
|
Loading…
Reference in New Issue
Block a user