diff --git a/Makefile b/Makefile index 599eaca..ea272e8 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,12 @@ ARCH := darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64 VERSION := $(shell git describe --always --dirty) +LDFLAGS := -ldflags "-X main.version=${VERSION}" -release: - gox -output 'build/{{.Dir}}.{{.OS}}.{{.Arch}}' -osarch "${ARCH}" -ldflags "-X main.version=${VERSION}" +yajsv: *.go + go build ${LDFLAGS} + +release: *.go + gox -output 'build/{{.Dir}}.{{.OS}}.{{.Arch}}' -osarch "${ARCH}" ${LDFLAGS} clean: - rm -rf build + rm -rf build yajsv diff --git a/main.go b/main.go index b456c63..9745470 100644 --- a/main.go +++ b/main.go @@ -17,11 +17,9 @@ import ( "github.com/xeipuuv/gojsonschema" ) -const ( +var ( version = "undefined" -) -var ( schemaFlag = flag.String("s", "", "primary JSON schema to validate against, required") quietFlag = flag.Bool("q", false, "quiet, only print validation failures and errors") versionFlag = flag.Bool("v", false, "print version and exit")