Browse Source

Added build scripts

master
Patrick Gaskin 6 months ago
parent
commit
41865109a7
Signed by: geek1011 GPG Key ID: A2FD79F68A2AB707
3 changed files with 7 additions and 1 deletions
  1. +2
    -0
      .gitignore
  2. +2
    -0
      Makefile
  3. +3
    -1
      main.go

+ 2
- 0
.gitignore View File

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

+ 2
- 0
Makefile View File

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

+ 3
- 1
main.go View File

@ -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

Loading…
Cancel
Save