Browse Source

Added build scripts

master
Patrick Gaskin 1 year ago
parent
commit
41865109a7
Signed by: geek1011 GPG Key ID: A2FD79F68A2AB707
  1. 2
      .gitignore
  2. 2
      Makefile
  3. 4
      main.go

2
.gitignore

@ -0,0 +1,2 @@
/data
/dashboard

2
Makefile

@ -0,0 +1,2 @@
dashboard: $(wildcard *.go)
go build -ldflags "-s -w -X main.version=$(shell git describe --always --tags)" -o $@ $^

4
main.go

@ -12,6 +12,8 @@ import (
"github.com/spf13/pflag"
)
const version = "dev"
func main() {
addr := pflag.StringP("addr", "a", ":8080", "The address to listen on")
iconsDir := pflag.StringP("icons-dir", "i", "./icons", "The directory where icons are stored")
@ -20,7 +22,7 @@ func main() {
pflag.Parse()
if *help {
fmt.Fprintf(os.Stderr, "Usage: %s [options]\n\nOptions:\n", os.Args[0])
fmt.Fprintf(os.Stderr, "Usage: %s [options]\n\nVersion:\n dashboard %s\n\nOptions:\n", os.Args[0], version)
pflag.PrintDefaults()
os.Exit(0)
return