From bb1a7f3f0ff042bb6efe3e7a83a4c6b1a46c4025 Mon Sep 17 00:00:00 2001 From: Justin McCarthy Date: Thu, 10 May 2018 23:23:50 -0700 Subject: [PATCH] homebrew --- .gitignore | 1 + Makefile | 7 +++++-- comply.rb | 22 ++++++++++++++++++++++ internal/cli/app.go | 4 +++- 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 comply.rb diff --git a/.gitignore b/.gitignore index 7f284ab..f2f4334 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ comply output +dist diff --git a/Makefile b/Makefile index d1d6f73..67ee0d6 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,11 @@ GO_SOURCES := $(shell find . -name '*.go') THEME_SOURCES := $(shell find themes) assets: $(THEME_SOURCES) - go-bindata-assetfs -pkg theme -prefix themes themes/... - mv bindata_assetfs.go internal/theme/themes_bindata.go + go get github.com/jteeuwen/go-bindata/... + go get github.com/elazarl/go-bindata-assetfs/... + go install github.com/elazarl/go-bindata-assetfs + go-bindata-assetfs -o bindata.go -pkg theme -prefix themes themes/... + mv bindata.go internal/theme/themes_bindata.go comply: assets $(GO_SOURCES) go build github.com/strongdm/comply/cmd/comply diff --git a/comply.rb b/comply.rb new file mode 100644 index 0000000..12a3a42 --- /dev/null +++ b/comply.rb @@ -0,0 +1,22 @@ +class Comply < Formula + desc "" + homepage "" + url "file:///Users/jmccarthy/Downloads/comply-1.1.3.tgz" + sha256 "01f9920e5e9fbd29386e4a4131fac78c002730e49c3f870a0ee2b958c3ce75f6" + + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + ENV.prepend_create_path "PATH", buildpath/"bin" + (buildpath/"src/github.com/strongdm/comply").install buildpath.children + cd "src/github.com/strongdm/comply" do + system "make", "brew" + bin.install "bin/comply" + end + end + + test do + system "#{bin}/sdm", "logout" + end +end diff --git a/internal/cli/app.go b/internal/cli/app.go index 264f51b..806ab4b 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -32,7 +32,9 @@ func Main() { func newApp() *cli.App { app := cli.NewApp() app.Name = "comply" - app.HideVersion = true + if Version == "" { + app.HideVersion = true + } app.Version = Version app.Usage = "policy compliance toolkit"