Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(manifest): Fix bugs in 'Get-Manifest()' #4986

Merged
merged 3 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lib/depends.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
}
Expand Down
2 changes: 1 addition & 1 deletion libexec/scoop-download.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand Down