allow non-git make
This commit is contained in:
parent
6b3e02e7cd
commit
7ab4051af3
4
build.sh
4
build.sh
@ -6,7 +6,9 @@ PROTECTED_MODE="no"
|
||||
|
||||
# Hardcode some values to the core package
|
||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}"
|
||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=$(git rev-parse --short HEAD)"
|
||||
if [ -d ".git" ]; then
|
||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=$(git rev-parse --short HEAD)"
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)"
|
||||
if [ "$PROTECTED_MODE" == "no" ]; then
|
||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
|
||||
|
@ -73,6 +73,10 @@ func main() {
|
||||
if host != "" {
|
||||
hostd = "Addr: " + host + ", "
|
||||
}
|
||||
gitsha := " (" + core.GitSHA + ")"
|
||||
if gitsha == " (0000000)" {
|
||||
gitsha = ""
|
||||
}
|
||||
|
||||
// _____ _ _ ___ ___
|
||||
// |_ _|_| |___|_ | . |
|
||||
@ -82,12 +86,12 @@ func main() {
|
||||
fmt.Fprintf(logw, `
|
||||
_______ _______
|
||||
| | |
|
||||
|____ | _ | Tile38 %s (%s) %d bit (%s/%s)
|
||||
|____ | _ | Tile38 %s%s %d bit (%s/%s)
|
||||
| | | %sPort: %d, PID: %d
|
||||
|____ | _ |
|
||||
| | | tile38.com
|
||||
|_______|_______|
|
||||
`+"\n", core.Version, core.GitSHA, strconv.IntSize, runtime.GOARCH, runtime.GOOS, hostd, port, os.Getpid())
|
||||
`+"\n", core.Version, gitsha, strconv.IntSize, runtime.GOARCH, runtime.GOOS, hostd, port, os.Getpid())
|
||||
|
||||
if err := controller.ListenAndServe(host, port, dir); err != nil {
|
||||
log.Fatal(err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user