diff --git a/CHANGELOG.md b/CHANGELOG.md index d066fef985..4dbee6ed5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - **core:** Add `Get-Encoding` function to fix missing webclient encoding ([#4956](https://github.com/ScoopInstaller/Scoop/issues/4956)) +### Bug Fixes + +- **manifest:** Fix bugs in 'Get-Manifest()' ([#4986](https://github.com/ScoopInstaller/Scoop/issues/4986)) + ## [v0.2.1](https://github.com/ScoopInstaller/Scoop/compare/v0.2.0...v0.2.1) - 2022-06-10 ### Features diff --git a/lib/depends.ps1 b/lib/depends.ps1 index 5f010f0119..bd2b26fb39 100644 --- a/lib/depends.ps1 +++ b/lib/depends.ps1 @@ -32,7 +32,7 @@ function Get-Dependency { $Unresolved = @() ) process { - $AppName, $manifest, $bucket, $null = Get-Manifest $AppName + $AppName, $manifest, $bucket, $url = Get-Manifest $AppName $Unresolved += $AppName if (!$manifest) { @@ -57,7 +57,11 @@ function Get-Dependency { if ($bucket) { $Resolved += "$bucket/$AppName" } else { - $Resolved += $AppName + if ($url) { + $Resolved += $url + } else { + $Resolved += $AppName + } } if ($Unresolved.Length -eq 0) { return $Resolved diff --git a/lib/manifest.ps1 b/lib/manifest.ps1 index 27087a4c3a..ffa76c7504 100644 --- a/lib/manifest.ps1 +++ b/lib/manifest.ps1 @@ -25,6 +25,7 @@ function url_manifest($url) { function Get-Manifest($app) { $bucket, $manifest, $url = $null + $app = $app.TrimStart('/') # check if app is a URL or UNC path if ($app -match '^(ht|f)tps?://|\\\\') { $url = $app @@ -45,6 +46,7 @@ function Get-Manifest($app) { if (!$manifest) { # couldn't find app in buckets: check if it's a local path $appPath = $app + $bucket = $null if (!$appPath.EndsWith('.json')) { $appPath += '.json' } diff --git a/libexec/scoop-download.ps1 b/libexec/scoop-download.ps1 index ff99995575..846750eb97 100644 --- a/libexec/scoop-download.ps1 +++ b/libexec/scoop-download.ps1 @@ -51,7 +51,7 @@ foreach ($curr_app in $apps) { $bucket = $version = $app = $manifest = $url = $null $app, $bucket, $version = parse_app $curr_app - $app, $manifest, $bucket, $url = Get-Manifest $curr_app + $app, $manifest, $bucket, $url = Get-Manifest "$bucket/$app" info "Starting download for $app..."