Skip to content

Commit df9a4d6

Browse files
committed
feat: support search across description
1 parent 86d69b8 commit df9a4d6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/search_cmd.go

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ func (s *searchCmd) Run(l *ui.UI, env *hermit.Env, state *state.State) error {
7878
pattern := s.Pattern
7979
if s.Exact {
8080
pattern = "^" + regexp.QuoteMeta(pattern) + "$"
81+
} else {
82+
pattern = "(?i)" + pattern
8183
}
8284
if env != nil {
8385
err = env.Update(l, false)

manifest/resolver.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (r *Resolver) Search(l ui.Logger, pattern string) (Packages, error) {
226226
return nil, errors.WithStack(err)
227227
}
228228
for _, manifest := range manifests {
229-
if !re.MatchString(manifest.Name) {
229+
if !re.MatchString(manifest.Name) && !re.MatchString(manifest.Description) && !re.MatchString(manifest.Homepage) {
230230
continue
231231
}
232232
if len(manifest.Errors) > 0 {

0 commit comments

Comments
 (0)