mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-05-04 00:31:27 +00:00
fix(scoop-search): Catch error of parsing invalid manifest (#5930)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
### Bug Fixes
|
||||
|
||||
- **json:** Serialize jsonpath return ([#5921](https://github.com/ScoopInstaller/Scoop/issues/5921))
|
||||
- **scoop-search:** Catch error of parsing invalid manifest ([#5930](https://github.com/ScoopInstaller/Scoop/issues/5930))
|
||||
|
||||
## [v0.4.1](https://github.com/ScoopInstaller/Scoop/compare/v0.4.0...v0.4.1) - 2024-04-25
|
||||
|
||||
|
||||
@@ -61,7 +61,15 @@ function search_bucket($bucket, $query) {
|
||||
$apps = Get-ChildItem (Find-BucketDirectory $bucket) -Filter '*.json' -Recurse
|
||||
|
||||
$apps | ForEach-Object {
|
||||
$json = [System.Text.Json.JsonDocument]::Parse([System.IO.File]::ReadAllText($_.FullName))
|
||||
$filepath = $_.FullName
|
||||
|
||||
$json = try {
|
||||
[System.Text.Json.JsonDocument]::Parse([System.IO.File]::ReadAllText($filepath))
|
||||
} catch {
|
||||
debug "Failed to parse manifest file: $filepath (error: $_)"
|
||||
return
|
||||
}
|
||||
|
||||
$name = $_.BaseName
|
||||
|
||||
if ($name -match $query) {
|
||||
|
||||
Reference in New Issue
Block a user