dkaslovsky / tabgrab

A small command-line tool to extract or restore the URL of every open tab in the current browser window on macOS.
MIT License
18 stars 0 forks source link

Add a brewfile (and maybe a tap) #1

Open seivan opened 4 months ago

seivan commented 4 months ago

I wrote a template, but feel free to change anything, test and submit to homebrew core.

class Tabgrab < Formula
  desc "Utility to grab terminal tabs"
  homepage "https://github.com/dkaslovsky/tabgrab"
  version "1.1.0"
  license "MIT"

  if OS.mac?
    if Hardware::CPU.arm?
      url "https://github.com/dkaslovsky/tabgrab/releases/download/v#{version}/tabgrab_darwin_arm64"
      sha256 "484348cd2c910cf8e8e2bdb9b785147ae5dc892272f89a0e84045005a647646f"
    elsif Hardware::CPU.intel?
      url "https://github.com/dkaslovsky/tabgrab/releases/download/v#{version}/tabgrab_darwin_amd64"
      sha256 "10a0323fed70fa3d2bd2bae6d363cc77587113a08673c06f40f098d6e529deb7"
    end
  else
    url "https://github.com/dkaslovsky/tabgrab/archive/refs/tags/v#{version}.tar.gz"
    sha256 "68810d8e22ac2021f9b4f8bf11ad34fb614d1d742459209af4cc93275257da02"
    depends_on "go" => :build
  end

  def install
    if OS.mac?
      if Hardware::CPU.arm?
        bin.install "tabgrab_darwin_arm64" => "tabgrab"
      elsif Hardware::CPU.intel?
        bin.install "tabgrab_darwin_amd64" => "tabgrab"
      end
    else
      system "go", "build", "-o", bin/"tabgrab"
    end
  end

  test do
    system "#{bin}/tabgrab", "--version"
  end
end
dkaslovsky commented 4 months ago

Thank you! I'll look to get this submitted in the coming days. I appreciate it.

luckman212 commented 4 months ago

Could also consider adding this 1-liner install to the README:

go install github.com/dkaslovsky/tabgrab@latest
dkaslovsky commented 4 months ago

Yes, this would be to build from source. The intended method of installation is to download a pre-built binary from the releases section of this repo. For example:

curl -o tabgrab -L https://github.com/dkaslovsky/tabgrab/releases/latest/download/tabgrab_darwin_arm64

I'll update the readme with these installation instructions soon and please let me know if you have any questions. Thanks!

dkaslovsky commented 4 months ago

I've updated the readme to include more detailed installation instructions. Thanks again!

seivan commented 1 week ago

@dkaslovsky Any chance you could submit the template to homebrew since you are the maintainer?

dkaslovsky commented 1 week ago

Thanks for the ping on this and my sincere apologies for the long delay. I will do this as I very much appreciate the interest and use of this tool. Given my current schedule, it likely will be a few weeks before I have the bandwidth but I do plan to get it done. Thanks again for your patience.