_scripts/make: do not exit if git SHA ID can not be retrieved (#2973)

Something changed in TeamCity's infrastructure that makes 'git
rev-parse HEAD' fail systematically on most configurations.
Since the SHA ID isn't necessary anyway, print an error and continue.
This commit is contained in:
Alessandro Arzilli 2022-04-18 19:47:44 +02:00 committed by GitHub
parent 3138157826
commit 75b4421d70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -294,11 +294,13 @@ func prepareMacnative() string {
}
func buildFlags() []string {
var ldFlags string
buildSHA, err := getBuildSHA()
if err != nil {
log.Fatal(fmt.Errorf("error getting build SHA via git: %w", err))
log.Printf("error getting build SHA via git: %w", err)
} else {
ldFlags = "-X main.Build=" + buildSHA
}
ldFlags := "-X main.Build=" + buildSHA
if runtime.GOOS == "darwin" {
ldFlags = "-s " + ldFlags
}