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

Set up Homebrew tap #7

Closed
zmwangx opened this issue Apr 13, 2017 · 8 comments
Closed

Set up Homebrew tap #7

zmwangx opened this issue Apr 13, 2017 · 8 comments

Comments

@zmwangx
Copy link
Contributor

zmwangx commented Apr 13, 2017

To set up a Homebrew tap, create a repository at jarun/homebrew-nnn, place the single file nnn.rb in it:

class Nnn < Formula
  desc "Free, fast, friendly file browser"
  homepage "https://github.com/jarun/nnn"
  url "https://github.com/jarun/nnn/archive/v1.0.tar.gz"
  sha256 "dd33f1001a87a427f10b6468db7dcba0bdc19643f121dbf6bb8655d5f2d3bac5"

  def install
    # Remove when Makefile is fixed
    inreplace "Makefile", "$(PREFIX)/man", "$(PREFIX)/share/man"
    system "make", "install", "PREFIX=#{prefix}"
  end

  test do
    touch "foobar"
    # Testing this curses app requires a pty
    require "pty"
    PTY.spawn(bin/"nnn") do |r, w, pid|
      w.write "q"
      assert_match "foobar", r.read
    end
  end
end

add an optional README if you want to, but Homebrew/Linuxbrew users who just do

brew install jarun/nnn

won't see the README.

@zmwangx
Copy link
Contributor Author

zmwangx commented Apr 13, 2017

By the way, currently the man page is installed into $(PREFIX)/man, when $(PREFIX)/share/man is more appropriate.

@jarun
Copy link
Owner

jarun commented Apr 13, 2017

I can still remove the tag and make the changes. We haven't posted it anywhere yet.

@zmwangx
Copy link
Contributor Author

zmwangx commented Apr 13, 2017

Sure.

@jarun
Copy link
Owner

jarun commented Apr 13, 2017

I'll add the instruction to the README for nnn.

@jarun
Copy link
Owner

jarun commented Apr 13, 2017

@zmwangx
Copy link
Contributor Author

zmwangx commented Apr 13, 2017

Cool. Just remember to update the checksum and remove the inreplace if you ever decide to retag.

@jarun
Copy link
Owner

jarun commented Apr 13, 2017

All done at 85d7f27.

@zmwangx
Copy link
Contributor Author

zmwangx commented Apr 13, 2017

LGTM.

@zmwangx zmwangx closed this as completed Apr 13, 2017
@lock lock bot locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants