Skip to content

Commit

Permalink
fix: solve prefix path filter. (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et authored Dec 9, 2024
1 parent 9c7509f commit 38ea77f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mageutil/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ func StartToolsAndServices() {
func CompileForPlatform(platform string, compileBinaries []string) {
var cmdBinaries, toolsBinaries []string

toolsPrefix := filepath.Join("tools", "")
cmdPrefix := filepath.Join("cmd", "")

for _, binary := range compileBinaries {
if strings.HasPrefix(binary, "tools/") {
toolsBinaries = append(toolsBinaries, strings.TrimPrefix(binary, "tools/"))
} else if strings.HasPrefix(binary, "cmd/") {
cmdBinaries = append(cmdBinaries, strings.TrimPrefix(binary, "cmd/"))
if strings.HasPrefix(binary, toolsPrefix) {
toolsBinaries = append(toolsBinaries, strings.TrimPrefix(binary, toolsPrefix))
} else if strings.HasPrefix(binary, cmdPrefix) {
cmdBinaries = append(cmdBinaries, strings.TrimPrefix(binary, cmdPrefix))
} else {
PrintYellow(fmt.Sprintf("Binary %s does not have a valid prefix. Skipping...", binary))
}
Expand Down

0 comments on commit 38ea77f

Please sign in to comment.