diff --git a/main.go b/main.go index 57a54f4..bf6bbe4 100644 --- a/main.go +++ b/main.go @@ -48,7 +48,13 @@ func main() { for _, bucket := range buckets { wg.Add(1) go func(file os.FileInfo) { - res := matchingManifests(bucketsPath+"\\"+file.Name()+"\\bucket", args.query) + // check if $bucketName/bucket exists, if not use $bucketName + bucketPath := bucketsPath + "\\" + file.Name() + if f, err := os.Stat(bucketPath + "\\bucket"); !os.IsNotExist(err) && f.IsDir() { + bucketPath += "\\bucket" + } + + res := matchingManifests(bucketPath, args.query) matches.Lock() matches.data[file.Name()] = res matches.Unlock() diff --git a/tests/integration.ps1 b/tests/integration.ps1 index 9ec4c46..82179a2 100644 --- a/tests/integration.ps1 +++ b/tests/integration.ps1 @@ -1,6 +1,9 @@ go build . -$terms = "fl", "android", "sudo", "", "azure", "t", "a", "P", "G", "as" +# add a bucket that holds manifests in root +scoop bucket add github-gh https://github.com/cli/scoop-gh.git + +$terms = "fl", "android", "sudo", "", "azure", "t", "a", "P", "G", "as", "gh" foreach ($term in $terms) { $s1 = (./scoop-search.exe $term)