Skip to content

Commit d762af6

Browse files
committed
fix windows false positives and order
1 parent e2838b6 commit d762af6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd/fetch.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ var (
3737
"linux": {"linux64"},
3838
}
3939
stopAliases = map[string][]string{
40-
"amd64": {"arm"},
40+
"amd64": {"arm"},
41+
"windows": {"darwin"},
4142
}
4243

4344
// fetchCmd represents the fetch command
@@ -211,6 +212,11 @@ func findMatching(toolName string, assets []types.Asset) *types.Asset {
211212
mi = !strings.Contains(matching[i].Name, ".")
212213
mj = !strings.Contains(matching[j].Name, ".")
213214
}
215+
if mi == mj {
216+
// prefer non archive files
217+
mi = strings.HasSuffix(matching[i].Name, defaultFileExtension())
218+
mj = strings.HasSuffix(matching[j].Name, defaultFileExtension())
219+
}
214220
if mi == mj {
215221
return true
216222
}

0 commit comments

Comments
 (0)