Skip to content

Commit

Permalink
Print version and git commit hash on start up
Browse files Browse the repository at this point in the history
  • Loading branch information
NicEastvillage committed Apr 3, 2024
1 parent c4378dd commit e9ec38c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.idea/
/build/
/dist/
/out/
/out/
ChessHeavenAndHell.exe
19 changes: 17 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
package main

import (
rl "github.com/gen2brain/raylib-go/raylib"

"fmt"
rg "github.com/gen2brain/raylib-go/raygui"
rl "github.com/gen2brain/raylib-go/raylib"
"runtime/debug"
)

const (
WindowWidth = 1600
WindowHeight = 980
)

// Commit Git hash for current commit
var Commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
return setting.Value
}
}
}

return ""
}()

func main() {
fmt.Printf("Starting Chess Heaven and Hell v1.0/%s\n", Commit[:7])
rl.SetConfigFlags(rl.FlagWindowResizable)
rl.InitWindow(WindowWidth, WindowHeight, "Chess - Heaven and Hell")
defer rl.CloseWindow()
Expand Down

0 comments on commit e9ec38c

Please sign in to comment.