From 60771583846499b745f0ae057df1db948ed65511 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Thu, 25 Jul 2024 13:50:35 +0800 Subject: [PATCH 1/2] fix(core): Use `Join-Path` to construct cache file path --- lib/core.ps1 | 2 +- lib/install.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core.ps1 b/lib/core.ps1 index 193a8c0020..23a10c32ed 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -407,7 +407,7 @@ function usermanifestsdir { "$(basedir)\workspace" } function usermanifest($app) { "$(usermanifestsdir)\$app.json" } function cache_path($app, $version, $url) { $underscoredUrl = $url -replace '[^\w\.\-]+', '_' - $filePath = "$cachedir\$app#$version#$underscoredUrl" + $filePath = Join-Path $cachedir "$app#$version#$underscoredUrl" # NOTE: Scoop cache files migration. Remove this 6 months after the feature ships. if (Test-Path $filePath) { diff --git a/lib/install.ps1 b/lib/install.ps1 index 6c8c3ff11a..54b0922e26 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -238,7 +238,7 @@ function Invoke-CachedAria2Download ($app, $version, $manifest, $architecture, $ foreach ($url in $urls) { $data.$url = @{ - 'target' = "$dir\$(url_filename $url)" + 'target' = Join-Path $dir (url_filename $url) 'cachename' = fname (cache_path $app $version $url) 'source' = cache_path $app $version $url } From 5a6477068b305b776bd5e23ebded81f9499c1e4e Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Thu, 25 Jul 2024 13:52:39 +0800 Subject: [PATCH 2/2] Update chglog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 296acb220b..62c6002c1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - **scoop-alias:** Fix 'Option --verbose not recognized.' ([#6062](https://github.com/ScoopInstaller/Scoop/issues/6062)) - **scoop-hold:** Use 'foreach' loop to allow 'continue' statement ([#6078](https://github.com/ScoopInstaller/Scoop/issues/6078)) +- **core:** Use 'Join-Path' to construct cache file path ([#6079](https://github.com/ScoopInstaller/Scoop/issues/6079)) - **json:** Don't serialize jsonpath return if only one result ([#6066](https://github.com/ScoopInstaller/Scoop/issues/6066), [#6073](https://github.com/ScoopInstaller/Scoop/issues/6073)) ### Builds