From 8c6f1043c50fbdf9a5433a552389ec40ae7a2e29 Mon Sep 17 00:00:00 2001 From: Fabrizio Ciccarese Date: Thu, 9 Feb 2023 21:58:32 +0100 Subject: [PATCH 1/3] fix(core): Checkver cannot read private_hosts config variable --- bin/checkver.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index 56b8c8c987..75e937df25 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -223,6 +223,12 @@ $Queue | ForEach-Object { $wc.Headers.Add('Authorization', "token $GitHubToken") } + get_config PRIVATE_HOSTS | Where-Object { $_ -ne $null -and $url -match $_.match } | ForEach-Object { + (ConvertFrom-StringData -StringData $_.Headers).GetEnumerator() | ForEach-Object { + $wc.Headers[$_.Key] = $_.Value + } + } + $url = substitute $url $substitutions $state = New-Object psobject @{ From 40bff1a343c10de81f5d59b0596e0f4aac90753d Mon Sep 17 00:00:00 2001 From: Fabrizio Ciccarese Date: Thu, 9 Feb 2023 22:27:23 +0100 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f45932ad68..80fea4f4b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - **decompress:** Exclude '*.nsis' that may cause error ([#5294](https://github.com/ScoopInstaller/Scoop/issues/5294)) - **autoupdate:** Fix file hash extraction ([#5295](https://github.com/ScoopInstaller/Scoop/issues/5295)) - **shortcuts:** Output correctly formatted path ([#5333](https://github.com/ScoopInstaller/Scoop/issues/5333)) +- **core:** Checkver can now read the private_host config variable ### Code Refactoring From 203df888f18e25862d0df4ca378ecc10a213ab9a Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Sat, 18 Feb 2023 22:47:48 +0800 Subject: [PATCH 3/3] Some fix --- CHANGELOG.md | 5 ++++- bin/checkver.ps1 | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80fea4f4b2..76c1200364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,13 +9,16 @@ - **decompress:** Exclude '*.nsis' that may cause error ([#5294](https://github.com/ScoopInstaller/Scoop/issues/5294)) - **autoupdate:** Fix file hash extraction ([#5295](https://github.com/ScoopInstaller/Scoop/issues/5295)) - **shortcuts:** Output correctly formatted path ([#5333](https://github.com/ScoopInstaller/Scoop/issues/5333)) -- **core:** Checkver can now read the private_host config variable ### Code Refactoring - **git:** Use Invoke-Git() with direct path to git.exe to prevent spawning shim subprocesses ([#5122](https://github.com/ScoopInstaller/Scoop/issues/5122), [#5375](https://github.com/ScoopInstaller/Scoop/issues/5375)) - **scoop-download:** Output more detailed manifest information ([#5277](https://github.com/ScoopInstaller/Scoop/issues/5277)) +### Builds + +- **checkver:** Read the private_host config variable ([#5381](https://github.com/ScoopInstaller/Scoop/issues/5381)) + ### Tests - **bucket:** Skip manifest validation if no manifest changes ([#5270](https://github.com/ScoopInstaller/Scoop/issues/5270)) diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index 75e937df25..e740208d99 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -223,26 +223,26 @@ $Queue | ForEach-Object { $wc.Headers.Add('Authorization', "token $GitHubToken") } + $url = substitute $url $substitutions + + $state = New-Object psobject @{ + app = $name + file = $file + url = $url + regex = $regex + json = $json + jsonpath = $jsonpath + xpath = $xpath + reverse = $reverse + replace = $replace + } + get_config PRIVATE_HOSTS | Where-Object { $_ -ne $null -and $url -match $_.match } | ForEach-Object { (ConvertFrom-StringData -StringData $_.Headers).GetEnumerator() | ForEach-Object { $wc.Headers[$_.Key] = $_.Value } } - $url = substitute $url $substitutions - - $state = New-Object psobject @{ - app = $name; - file = $file; - url = $url; - regex = $regex; - json = $json; - jsonpath = $jsonpath; - xpath = $xpath; - reverse = $reverse; - replace = $replace; - } - $wc.Headers.Add('Referer', (strip_filename $url)) $wc.DownloadDataAsync($url, $state) }