Skip to content

Commit

Permalink
fix(install): Report unsupported architecture
Browse files Browse the repository at this point in the history
- Closes #66

Revert 1531b6d
  • Loading branch information
Ash258 committed Oct 3, 2020
1 parent 1531b6d commit 2ee175c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 6 additions & 0 deletions lib/decompress.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ function Test-7zipRequirement {
[OutputType([Boolean])]
param (
[Parameter(Mandatory, ParameterSetName = 'URL')]
[AllowNull()]
[String[]] $URL,
[Parameter(Mandatory, ParameterSetName = 'File')]
[String] $File
)

if (!$File -and ($null -eq $URL)) { return $false }

if (get_config '7ZIPEXTRACT_USE_EXTERNAL' $false) { return $false }

if ($URL) {
Expand All @@ -28,9 +31,12 @@ function Test-LessmsiRequirement {
[OutputType([Boolean])]
param (
[Parameter(Mandatory)]
[AllowNull()]
[String[]] $URL
)

if ($null -eq $URL) { return $false }

if (get_config 'MSIEXTRACT_USE_LESSMSI' $false) {
return ($URL | Where-Object { $_ -match '\.msi$' }).Count -gt 0
} else {
Expand Down
3 changes: 1 addition & 2 deletions lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function install_app($app, $architecture, $global, $suggested, $use_cache = $tru
}

if (!(supports_architecture $manifest $architecture)) {
Write-UserMessage -Message "'$app' doesn't support $architecture architecture!" -Color DarkRed
return
throw "'$app' does not support $architecture architecture"
}

$buc = if ($bucket) { " [$bucket]" } else { '' }
Expand Down
6 changes: 1 addition & 5 deletions lib/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ function arch_specific($prop, $manifest, $architecture) {
if ($val) { return $val } # else fallback to generic prop
}

if ($manifest.$prop) {
return $manifest.$prop
} else {
throw "Manifest does not support $architecture architecture"
}
if ($manifest.$prop) { return $manifest.$prop }
}

function supports_architecture($manifest, $architecture) {
Expand Down

0 comments on commit 2ee175c

Please sign in to comment.