Skip to content

Commit

Permalink
fix: allow word in package name
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jun 26, 2022
1 parent 92bc6b2 commit 80b46f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/generate-registry/generate.go
Expand Up @@ -64,7 +64,7 @@ func (ctrl *Controller) genRegistry(ctx context.Context, param *config.Param, lo
return nil
}

func (ctrl *Controller) excludeAsset(assetName string) bool {
func (ctrl *Controller) excludeAsset(pkgName, assetName string) bool {
format := ctrl.getFormat(assetName)
allowedExts := map[string]struct{}{
".exe": {},
Expand Down Expand Up @@ -96,7 +96,7 @@ func (ctrl *Controller) excludeAsset(assetName string) bool {
"checksum",
}
for _, s := range words {
if strings.Contains(asset, s) {
if strings.Contains(asset, s) && !strings.Contains(pkgName, s) {
return true
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ func (ctrl *Controller) getPackageInfo(ctx context.Context, logE *logrus.Entry,
assetInfos := make([]*AssetInfo, 0, len(assets))
for _, asset := range assets {
assetName := asset.GetName()
if ctrl.excludeAsset(assetName) {
if ctrl.excludeAsset(pkgName, assetName) {
logE.WithField("asset_name", assetName).Debug("exclude an asset")
continue
}
Expand Down

0 comments on commit 80b46f5

Please sign in to comment.