Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable linux support for pivnet CLI #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 21 additions & 3 deletions pivnet-cli.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
require 'formula'

class PivnetCli < Formula
class << self
def product_filename
if OS.mac?
"pivnet-darwin-amd64-#{version}"
else
"pivnet-linux-amd64-#{version}"
end
end

def product_sha
if OS.mac?
"6eaadefe76eb96342b0ee8909625027b157e06d417e9a5ed8b413435c876351f"
else
"7ade3877a7e973227c58cac6ae3a51ad788130387c166463691fe08f377928fc"
end
end
end

homepage 'https://github.com/pivotal-cf/pivnet-cli'
version "3.0.1"
url "https://github.com/pivotal-cf/pivnet-cli/releases/download/v#{version}/pivnet-darwin-amd64-#{version}"
sha256 "6eaadefe76eb96342b0ee8909625027b157e06d417e9a5ed8b413435c876351f"
url "https://github.com/pivotal-cf/pivnet-cli/releases/download/v#{version}/#{product_filename}"
sha256 product_sha

depends_on :arch => :x86_64

def install
mv "pivnet-darwin-amd64-#{version}", "pivnet"
mv self.class.product_filename, "pivnet"
bin.install "pivnet"
end

Expand Down