Skip to content

Commit

Permalink
goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyblue committed Oct 19, 2018
1 parent 90c61a1 commit 4aa0f71
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
sqlfmt
12 changes: 12 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
builds:
- env:
- CGO_ENABLED=0
goarch:
- amd64
goos:
- linux
- darwin
- windows
archive:
files:
- none*
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ var (
flagAlign = flag.Bool("align", false, "right-align keywords")
flagStmts = flag.StringArray("stmt", nil, "instead of reading from stdin, specify statements as arguments")
flagHelp = flag.BoolP("help", "h", false, "display help")
flagVersion = flag.BoolP("version", "v", false, "display version")
)

var (
version = "dev"
commit = "none"
date = "unknown"
)

func main() {
Expand All @@ -64,6 +71,10 @@ SQLFMT_ADDR=":8080" %[1]s
`, os.Args[0])
return
}
if *flagVersion {
fmt.Printf("sqlfmt %s\n", version)
return
}

var spec Specification
err := envconfig.Process("sqlfmt", &spec)
Expand Down

0 comments on commit 4aa0f71

Please sign in to comment.