We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c98e8b6 commit bf02470Copy full SHA for bf02470
1 file changed
libexec/scoop-search.ps1
@@ -29,13 +29,21 @@ function search_bucket($bucket, $query) {
29
@{ name = $_ }
30
}
31
32
- if($query) { $apps = $apps | ? {
33
- if($_.name -match $query) { return $true }
34
- $bin = bin_match (manifest $_.name $bucket) $query
35
- if($bin) {
36
- $_.bin = $bin; return $true;
+ if($query) {
+ try {
+ $query = new-object regex $query
+ } catch {
+ abort "invalid regular expression: $($_.exception.innerexception.message)"
37
38
- } }
+
39
+ $apps = $apps | ? {
40
+ if($_.name -match $query) { return $true }
41
+ $bin = bin_match (manifest $_.name $bucket) $query
42
+ if($bin) {
43
+ $_.bin = $bin; return $true;
44
+ }
45
46
47
$apps | % { $_.version = (latest_version $_.name $bucket); $_ }
48
49
0 commit comments