Skip to content

Commit

Permalink
added liquid template for cli formula
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmaccallum committed Jul 24, 2024
1 parent c48dcd1 commit 3455372
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Templates/parra-cli.rb.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
VERSION = "{{ release.version }}"
ARM_SHA = "{{ release.checksum.arm }}"
X86_SHA = "{{ release.checksum.x86 }}"
DESCRIPTION = "{{ release.description, 'default: A utility for getting started with your next Parra.io project.' }}"

class ParraCli < Formula
desc DESCRIPTION
homepage "https://parra.io"
license "MIT"
url "https://github.com/Parra-Inc/parra-cli.git", tag: VERSION

on_macos do
if Hardware::CPU.arm?
url "https://github.com/Parra-Inc/parra-cli/releases/download/v#{VERSION}/parra-cli-#{VERSION}.aarch64_apple_darwin.tar.gz"
sha256 ARM_SHA
elsif Hardware::CPU.intel?
url "https://github.com/Parra-Inc/parra-cli/releases/download/v#{VERSION}/parra-cli-#{VERSION}.x86_64_apple_darwin.tar.gz"
sha256 X86_SHA
end
end

depends_on "xcodegen"

def install
# Not including the `target/` base dir. Brew auto opens the top level directory.
if Hardware::CPU.intel?
bin.install "x86_64-apple-darwin/release/parra"
elsif Hardware::CPU.arm?
bin.install "aarch64-apple-darwin/release/parra"
end
end
end

0 comments on commit 3455372

Please sign in to comment.