From a1624abb6d5357815d548821a2cbf5e795d4dd3f Mon Sep 17 00:00:00 2001 From: Ash258 Date: Tue, 30 Jun 2020 20:41:03 +0200 Subject: [PATCH] fix(download): Fosshub URL download --- lib/core.ps1 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/core.ps1 b/lib/core.ps1 index a316937024..bb06a4768e 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -342,11 +342,11 @@ function app_status($app, $global) { return !(installed $app) } - if ($deps) { - $status.missing_deps += , $deps - } +if ($deps) { + $status.missing_deps += , $deps +} - return $status +return $status } function appname_from_url($url) { return (Split-Path $url -Leaf) -replace '\.json$' } @@ -926,13 +926,14 @@ function handle_special_urls($url) { # FossHub.com if ($url -match "^(?:.*fosshub.com\/)(?.*)(?:\/|\?dwl=)(?.*)$") { $Body = @{ - projectUri = $Matches.name - fileName = $Matches.filename - isLatestVersion = $true + 'projectUri' = $Matches.name + 'fileName' = $Matches.filename + 'source' = 'CF' + 'isLatestVersion' = $true } if ((Invoke-RestMethod -Uri $url) -match '"p":"(?[a-f0-9]{24}).*?"r":"(?[a-f0-9]{24})') { - $Body.Add("projectId", $Matches.pid) - $Body.Add("releaseId", $Matches.rid) + $Body.Add('projectId', $Matches.pid) + $Body.Add('releaseId', $Matches.rid) } $url = Invoke-RestMethod -Method Post -Uri "https://api.fosshub.com/download/" -ContentType "application/json" -Body (ConvertTo-Json $Body -Compress) if ($null -eq $url.error) {