feat: include version info in the binaries

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-09-15 18:07:38 +03:00
parent f8c522873c
commit 2b38e11643
6 changed files with 69 additions and 4 deletions

View File

@ -13,6 +13,7 @@ import (
"github.com/vsariola/sointu"
"github.com/vsariola/sointu/oto"
"github.com/vsariola/sointu/version"
"github.com/vsariola/sointu/vm/compiler/bridge"
)
@ -27,8 +28,13 @@ func main() {
rawOut := flag.Bool("r", false, "Output the rendered song as .raw file. By default, saves stereo float32 buffer to disk.")
wavOut := flag.Bool("w", false, "Output the rendered song as .wav file. By default, saves stereo float32 buffer to disk.")
pcm := flag.Bool("c", false, "Convert audio to 16-bit signed PCM when outputting.")
versionFlag := flag.Bool("v", false, "Print version.")
flag.Usage = printUsage
flag.Parse()
if *versionFlag {
fmt.Println(version.VersionOrHash)
os.Exit(0)
}
if flag.NArg() == 0 || *help {
flag.Usage()
os.Exit(0)