From 46962bcf40b0c5a910b379a9b553f887e006075e Mon Sep 17 00:00:00 2001 From: Karim Hamidou Date: Mon, 8 Jul 2024 07:35:02 -0700 Subject: [PATCH] build from source instead --- Casks/prguy.rb | 16 ---------------- Formula/p/prguy.rb | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 16 deletions(-) delete mode 100644 Casks/prguy.rb create mode 100644 Formula/p/prguy.rb diff --git a/Casks/prguy.rb b/Casks/prguy.rb deleted file mode 100644 index a55a6d4..0000000 --- a/Casks/prguy.rb +++ /dev/null @@ -1,16 +0,0 @@ -cask "prguy" do - version "0.5" - sha256 "956c0c0ff6a4e4d41349c7900635bda7c134dc7cfd18bc6380229f4956f21de4" - - url "https://github.com/khamidou/prguy/releases/download/#{version}/prguy" - name "PRGuy" - desc "Watch your PRs like a hawk" - homepage "https://github.com/khamidou/prguy" - - binary "prguy" - - postflight do - set_permissions "#{staged_path}/prguy", "0755" - end - -end diff --git a/Formula/p/prguy.rb b/Formula/p/prguy.rb new file mode 100644 index 0000000..fb41f0e --- /dev/null +++ b/Formula/p/prguy.rb @@ -0,0 +1,22 @@ +class GoCritic < Formula + name "PRGuy" + desc "Watch your PRs like a hawk" + homepage "https://github.com/khamidou/prguy" + + url "https://github.com/khamidou/prguy/archive/refs/tags/0.5.tar.gz" + sha256 "c9b18b094a39f6e6468e1f3fca0b6038a1246ba676c7e915759b54df2dde691e" + license "MIT" + head "https://github.com/khamidou/prguy.git", branch: "main" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + depends_on "go" + + def install + ldflags = "-s -w" + ldflags += " -X main.Version=v#{version}" unless build.head? + system "go", "build", *std_go_args(ldflags:, output: bin/"prguy"), "./cmd/prguy" + end +end -- 2.43.0