mklement0 / ttab

macOS and Linux CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
285 stars 15 forks source link

Publish homebrew formula #49

Closed memark closed 1 year ago

memark commented 1 year ago

It would make the installation even easier if the homebrew formula for ttab was published to a homebrew tap.

mklement0 commented 1 year ago

Thanks for the suggestion.

At this point ttab may be "notable" enough to warrant inclusion as a Homebrew core formula.

Honestly, I know little about this, except that it should be someone other than the developer attempting a PR.

brew audit with the formula file below at least doesn't complain about lack of notability.

If you're up for trying it, please do.

ttab.rb:

# typed: false
# frozen_string_literal: true

# CLI for opening tabs/windows in Terminal, iTerm2, or Gnome Terminal
class Ttab < Formula
  desc "CLI for opening tabs/windows in Terminal, iTerm2, or Gnome Terminal"
  homepage "https://github.com/mklement0/ttab"
  url "https://github.com/mklement0/ttab/archive/v0.7.3.tar.gz"
  sha256 "12871b3e7d6ce33d3a66ca57f41dbcb782746b5e59fca3e6b1eac084cf3f9337"

  def install
    bin.install "bin/ttab"
    man1.install "man/ttab.1"
  end

  test do
    stdout = shell_output "#{bin}/ttab --version"
    assert_match(/ttab v#{version}/, stdout)
  end
end
joelbernstein commented 1 year ago

This already works:

brew tap mklement0/ttab https://github.com/mklement0/ttab.git
brew install mklement0/ttab/ttab

The only reason you can't just do brew install mklement0/ttab/ttab is that the file would need to be in a github repository called homebrew-ttab for brew to infer the tap automatically. But since it isn't, passing the git url in works too.

The README should be updated to reflect this. It's much more useful - this way brew will also fetch updates to ttab.