Skip to content

Commit

Permalink
feat: support glob match in filename
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaryuan committed Jan 11, 2025
1 parent 2993728 commit 303e25a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions metascoop/apps/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package apps
import (
"context"
"fmt"
"path/filepath"
"strings"
"unicode"

Expand All @@ -18,8 +19,12 @@ func FindAPK(release *github.RepositoryRelease, filename string) *github.Release
continue
}

if asset.Name != nil && asset.GetName() == filename {
return asset
if asset.Name != nil {
assetName := asset.GetName()
matched, err := filepath.Match(filename, assetName)
if err == nil && matched {
return asset
}
}
}

Expand Down

0 comments on commit 303e25a

Please sign in to comment.