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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

- **scoop-search:** Output PSObject, use API token ([#4997](https://github.com/ScoopInstaller/Scoop/issues/4997))

### Builds

- **checkver,auto-pr:** Allow passing file path ([#5019](https://github.com/ScoopInstaller/Scoop/issues/5019))

### Tests

- **typo:** Fix typo ('formated' -> 'formatted') ([#4217](https://github.com/ScoopInstaller/Scoop/issues/4217))
Expand Down
9 changes: 7 additions & 2 deletions bin/auto-pr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ param(
[String] $Upstream,
[String] $OriginBranch = 'master',
[String] $App = '*',
[Parameter(Mandatory = $true)]
[ValidateScript( {
if (!(Test-Path $_ -Type Container)) {
throw "$_ is not a directory!"
Expand All @@ -64,7 +63,13 @@ param(
. "$PSScriptRoot\..\lib\json.ps1"
. "$PSScriptRoot\..\lib\unix.ps1"

$Dir = Resolve-Path $Dir
if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) {
$Dir = Split-Path $App
} elseif ($Dir) {
$Dir = Resolve-Path $Dir
} else {
throw "'-Dir' parameter required if '-App' is not a filepath!"
}

if ((!$Push -and !$Request) -or $Help) {
Write-Host @'
Expand Down
20 changes: 13 additions & 7 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#>
param(
[String] $App = '*',
[Parameter(Mandatory = $true)]
[ValidateScript( {
if (!(Test-Path $_ -Type Container)) {
throw "$_ is not a directory!"
Expand All @@ -77,8 +76,16 @@ param(
. "$PSScriptRoot\..\lib\install.ps1" # needed for hash generation
. "$PSScriptRoot\..\lib\unix.ps1"

$Dir = Resolve-Path $Dir
$Search = $App
if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) {
$Dir = Split-Path $App
$files = Get-ChildItem $Dir (Split-Path $App -Leaf)
} elseif ($Dir) {
$Dir = Resolve-Path $Dir
$files = Get-ChildItem $Dir "$App.json"
} else {
throw "'-Dir' parameter required if '-App' is not a filepath!"
}

$GitHubToken = Get-GitHubToken

# don't use $Version with $App = '*'
Expand All @@ -89,17 +96,16 @@ if ($App -eq '*' -and $Version -ne '') {
# get apps to check
$Queue = @()
$json = ''
Get-ChildItem $Dir "$App.json" | ForEach-Object {
$files | ForEach-Object {
$json = parse_json "$Dir\$($_.Name)"
if ($json.checkver) {
$Queue += , @($_.Name, $json)
}
}

# clear any existing events
Get-Event | ForEach-Object {
Remove-Event $_.SourceIdentifier
}
Get-Event | Remove-Event
Get-EventSubscriber | Unregister-Event

# start all downloads
$Queue | ForEach-Object {
Expand Down