Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features

- **checkver:** Add option to throw error as exception ([#4863](https://github.com/ScoopInstaller/Scoop/issues/4863))
- **install:** Allow downloading from private repositories ([#4254](https://github.com/ScoopInstaller/Scoop/issues/4243))

### Bug Fixes
Expand Down
9 changes: 6 additions & 3 deletions bin/auto-pr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
An array of manifests, which should be updated all the time. (-ForceUpdate parameter to checkver)
.PARAMETER SkipUpdated
Updated manifests will not be shown.
.PARAMETER ThrowError
Throw error as exception instead of just printing it.
.EXAMPLE
PS BUCKETROOT > .\bin\auto-pr.ps1 'someUsername/repository:branch' -Request
.EXAMPLE
Expand Down Expand Up @@ -54,7 +56,8 @@ param(
[Switch] $Request,
[Switch] $Help,
[string[]] $SpecialSnowflakes,
[Switch] $SkipUpdated
[Switch] $SkipUpdated,
[Switch] $ThrowError
)

. "$PSScriptRoot\..\lib\manifest.ps1"
Expand Down Expand Up @@ -160,11 +163,11 @@ if ($Push) {
execute "hub push origin $OriginBranch"
}

. "$PSScriptRoot\checkver.ps1" -App $App -Dir $Dir -Update -SkipUpdated:$SkipUpdated
. "$PSScriptRoot\checkver.ps1" -App $App -Dir $Dir -Update -SkipUpdated:$SkipUpdated -ThrowError:$ThrowError
if ($SpecialSnowflakes) {
Write-Host "Forcing update on our special snowflakes: $($SpecialSnowflakes -join ',')" -ForegroundColor DarkCyan
$SpecialSnowflakes -split ',' | ForEach-Object {
. "$PSScriptRoot\checkver.ps1" $_ -Dir $Dir -ForceUpdate
. "$PSScriptRoot\checkver.ps1" $_ -Dir $Dir -ForceUpdate -ThrowError:$ThrowError
}
}

Expand Down
11 changes: 9 additions & 2 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
Updated manifests will not be shown.
.PARAMETER Version
Update manifest to specific version.
.PARAMETER ThrowError
Throw error as exception instead of just printing it.
.EXAMPLE
PS BUCKETROOT > .\bin\checkver.ps1
Check all manifest inside default directory.
Expand Down Expand Up @@ -62,7 +64,8 @@ param(
[Switch] $Update,
[Switch] $ForceUpdate,
[Switch] $SkipUpdated,
[String] $Version = ''
[String] $Version = '',
[Switch] $ThrowError
)

. "$PSScriptRoot\..\lib\core.ps1"
Expand Down Expand Up @@ -336,7 +339,11 @@ while ($in_progress -gt 0) {
try {
Invoke-AutoUpdate $App $Dir $json $ver $matchesHashtable
} catch {
error $_.Exception.Message
if ($ThrowError) {
throw $_
} else {
error $_.Exception.Message
}
}
}
}