Skip to content

Commit 40450bf

Browse files
authored
Merge branch 'develop' into fix-date-format
2 parents 1f4c3fd + c9f0728 commit 40450bf

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
### Bug Fixes
44

55
- **scoop-download**: Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386))
6-
- **buckets|scoop-info**: Switch git log date format to ISO 8601 to avoid locale issues ([#6446](https://github.com/ScoopInstaller/Scoop/pull/6446))
6+
- **autoupdate:** Use origin URL to handle URLs with fragment in GitHub mode ([#6455](https://github.com/ScoopInstaller/Scoop/issues/6455))
7+
- **buckets|scoop-info:** Switch git log date format to ISO 8601 to avoid locale issues ([#6446](https://github.com/ScoopInstaller/Scoop/pull/6446))
78

89
## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11
910

lib/autoupdate.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
function format_hash([String] $hash) {
44
$hash = $hash.toLower()
55

6+
# Workaround for GitHub API:
7+
# `"digest": "sha256:<SHA256_STRING>"`
68
if ($hash -like 'sha256:*') {
79
$hash = $hash.Substring(7) # Remove prefix 'sha256:'
810
}
@@ -209,13 +211,14 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u
209211
$hash = $null
210212

211213
$hashmode = $config.mode
214+
$originurl = strip_fragment $url
212215
$basename = [System.Web.HttpUtility]::UrlDecode((url_remote_filename($url)))
213216

214217
$substitutions = $substitutions.Clone()
215-
$substitutions.Add('$url', (strip_fragment $url))
216-
$substitutions.Add('$baseurl', (strip_filename (strip_fragment $url)).TrimEnd('/'))
218+
$substitutions.Add('$url', $originurl)
219+
$substitutions.Add('$baseurl', (strip_filename $originurl).TrimEnd('/'))
217220
$substitutions.Add('$basename', $basename)
218-
$substitutions.Add('$urlNoExt', (strip_ext (strip_fragment $url)))
221+
$substitutions.Add('$urlNoExt', (strip_ext $originurl))
219222
$substitutions.Add('$basenameNoExt', (strip_ext $basename))
220223

221224
debug $substitutions
@@ -297,7 +300,7 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u
297300
}
298301
'github' {
299302
$hashfile_url = "https://api.github.com/repos/$($matches['owner'])/$($matches['repo'])/releases"
300-
$hash = find_hash_in_json $hashfile_url $substitutions ("$..assets[?(@.browser_download_url == '" + $url + "')].digest")
303+
$hash = find_hash_in_json $hashfile_url $substitutions ("$..assets[?(@.browser_download_url == '" + $originurl + "')].digest")
301304
}
302305
}
303306

0 commit comments

Comments
 (0)