diff --git a/CHANGELOG.md b/CHANGELOG.md index f4ccdc1d81..2def164e2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Bug Fixes +- **install:** Move from cache when `--no-cache` is specified ([#5039](https://github.com/ScoopInstaller/Scoop/issues/5039)) - **scoop-status:** Correct formatting of `Info` output ([#5047](https://github.com/ScoopInstaller/Scoop/issues/5047)) ## [v0.2.3](https://github.com/ScoopInstaller/Scoop/compare/v0.2.2...v0.2.3) - 2022-07-07 diff --git a/lib/install.ps1 b/lib/install.ps1 index 648255fcdf..056029e06e 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -90,7 +90,11 @@ function dl_with_cache($app, $version, $url, $to, $cookies = $null, $use_cache = } else { write-host "Loading $(url_remote_filename $url) from cache"} if (!($null -eq $to)) { - Copy-Item $cached $to + if ($use_cache) { + Copy-Item $cached $to + } else { + Move-Item $cached $to -Force + } } }