mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-08-29 01:26:44 +00:00
fix(autoupdate): remove any whitespace from hash (#3579)
Allow extracting hashes with containing spaces and newlines
(e.g. `ef 5d 41 08 32 9c 71 b4 b5 b6 0f be 2f bc 49 ac ef 86 69 49 42 e8 37 65 a4 86 30
10 ea be 0d 79`)
FreeCad Example:
```json
"hash": {
"url": "$url-SHA256.txt",
"regex": "(?sm):\\s+([a-f\\d\\s]+)CertUtil"
}
```
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ function find_hash_in_textfile([String] $url, [Hashtable] $substitutions, [Strin
|
||||
$regex = substitute $regex $substitutions $true
|
||||
debug $regex
|
||||
if ($hashfile -match $regex) {
|
||||
$hash = $matches[1] -replace ' ',''
|
||||
$hash = $matches[1] -replace '\s',''
|
||||
}
|
||||
|
||||
# convert base64 encoded hash values
|
||||
|
||||
Reference in New Issue
Block a user