postbuild hook fix (#2839)

postbuildhook should only run if application was built
This commit is contained in:
Nobleman
2023-08-29 18:47:14 +10:00
committed by GitHub
parent dab762937b
commit 4ad4d7c7e3
+6 -6
View File
@@ -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
}