You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the event that a bucket is added that includes JSON files with an Array as the root element the scoop search command will throw an error for every offending file.
Expected Behavior
JSON files with arrays as root elements will be skipped
Additional context/output
MethodInvocationException: C:\...\scoop\apps\scoop\current\libexec\scoop-search.ps1:38
Line |
38 | if (!$json.RootElement.TryGetProperty('bin', [ref] $bin)) { retur …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "TryGetProperty" with "2" argument(s): "The requested operation requires an element of type 'Object', but the target element
| has type 'Array'."
Possible Solution
Adding the following on the first line of the bin_match_json method in scoop-search.ps1 will skip JSON files with arrays as root elements.
if ($json.RootElement.ValueKind-eq [System.Text.Json.JsonValueKind]::Array) { return$false }
Bug Report
Current Behavior
In the event that a bucket is added that includes JSON files with an Array as the root element the
scoop search
command will throw an error for every offending file.Expected Behavior
JSON files with arrays as root elements will be skipped
Additional context/output
Possible Solution
Adding the following on the first line of the
bin_match_json
method inscoop-search.ps1
will skip JSON files with arrays as root elements.System details
Windows version:
11
OS architecture:
64bit
PowerShell version:
7.4.6
Scoop Configuration
The text was updated successfully, but these errors were encountered: