mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 12:44:19 +01:00
44 lines
806 B
Go
44 lines
806 B
Go
//go:build js && wasm
|
|
// +build js,wasm
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime/debug"
|
|
)
|
|
|
|
var (
|
|
Version = "dev"
|
|
CommitSHA = "unknown"
|
|
BuildTime = "unknown"
|
|
)
|
|
|
|
func init() {
|
|
if info, available := debug.ReadBuildInfo(); available {
|
|
for _, setting := range info.Settings {
|
|
switch setting.Key {
|
|
case "vcs.revision":
|
|
CommitSHA = setting.Value
|
|
case "vcs.time":
|
|
BuildTime = setting.Value
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// PrintBuildInfo prints the build information
|
|
func PrintBuildInfo() {
|
|
fmt.Printf("ARK SDK WebAssembly Module\n")
|
|
fmt.Printf("Version: %s\n", Version)
|
|
fmt.Printf("Commit: %s\n", CommitSHA)
|
|
fmt.Printf("Build Time: %s\n", BuildTime)
|
|
}
|
|
|
|
// GetVersion returns the version string
|
|
func GetVersion() string {
|
|
return Version
|
|
}
|
|
|
|
// You can add more build-related functions here as needed
|