diff --git a/v2/pkg/commands/build/build.go b/v2/pkg/commands/build/build.go index 81dd5ae3..774e97c2 100644 --- a/v2/pkg/commands/build/build.go +++ b/v2/pkg/commands/build/build.go @@ -146,15 +146,15 @@ func Build(options *Options) (string, error) { if err != nil { return "", err } - } - hookArgs["${bin}"] = compileBinary - for _, hook := range []string{options.Platform + "/" + options.Arch, options.Platform + "/*", "*/*"} { - if err := execPostBuildHook(outputLogger, options, hook, hookArgs); err != nil { - return "", err + hookArgs["${bin}"] = compileBinary + for _, hook := range []string{options.Platform + "/" + options.Arch, options.Platform + "/*", "*/*"} { + if err := execPostBuildHook(outputLogger, options, hook, hookArgs); err != nil { + return "", err + } } - } + } return compileBinary, nil }