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
|
# 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.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)"
|
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)"
|
||||||
if [ "$PROTECTED_MODE" == "no" ]; then
|
if [ "$PROTECTED_MODE" == "no" ]; then
|
||||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
|
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
|
||||||
|
@ -73,6 +73,10 @@ func main() {
|
|||||||
if host != "" {
|
if host != "" {
|
||||||
hostd = "Addr: " + host + ", "
|
hostd = "Addr: " + host + ", "
|
||||||
}
|
}
|
||||||
|
gitsha := " (" + core.GitSHA + ")"
|
||||||
|
if gitsha == " (0000000)" {
|
||||||
|
gitsha = ""
|
||||||
|
}
|
||||||
|
|
||||||
// _____ _ _ ___ ___
|
// _____ _ _ ___ ___
|
||||||
// |_ _|_| |___|_ | . |
|
// |_ _|_| |___|_ | . |
|
||||||
@ -82,12 +86,12 @@ func main() {
|
|||||||
fmt.Fprintf(logw, `
|
fmt.Fprintf(logw, `
|
||||||
_______ _______
|
_______ _______
|
||||||
| | |
|
| | |
|
||||||
|____ | _ | Tile38 %s (%s) %d bit (%s/%s)
|
|____ | _ | Tile38 %s%s %d bit (%s/%s)
|
||||||
| | | %sPort: %d, PID: %d
|
| | | %sPort: %d, PID: %d
|
||||||
|____ | _ |
|
|____ | _ |
|
||||||
| | | tile38.com
|
| | | 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 {
|
if err := controller.ListenAndServe(host, port, dir); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user