mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-04 03:11:55 +02:00
955f7eee76
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
41 lines
771 B
Go
41 lines
771 B
Go
//go:generate go install github.com/golangci/golangci-lint/cmd/golangci-lint
|
|
//go:generate go install github.com/client9/misspell/cmd/misspell
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/goreleaser/goreleaser/cmd"
|
|
)
|
|
|
|
// nolint: gochecknoglobals
|
|
var (
|
|
version = "dev"
|
|
commit = ""
|
|
date = ""
|
|
builtBy = ""
|
|
)
|
|
|
|
func main() {
|
|
cmd.Execute(
|
|
buildVersion(version, commit, date, builtBy),
|
|
os.Exit,
|
|
os.Args[1:],
|
|
)
|
|
}
|
|
|
|
func buildVersion(version, commit, date, builtBy string) string {
|
|
var result = version
|
|
if commit != "" {
|
|
result = fmt.Sprintf("%s\ncommit: %s", result, commit)
|
|
}
|
|
if date != "" {
|
|
result = fmt.Sprintf("%s\nbuilt at: %s", result, date)
|
|
}
|
|
if builtBy != "" {
|
|
result = fmt.Sprintf("%s\nbuilt by: %s", result, builtBy)
|
|
}
|
|
return result
|
|
}
|