aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/z.rb
blob: 877e5e72ccf1ab0045888f0a6eacece03d776beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'formula'

class Z < Formula
  homepage 'https://github.com/rupa/z'
  url 'https://github.com/rupa/z/archive/v1.6.tar.gz'
  sha1 '3efddaddb4f68b76f91e504885bb7bf524730086'

  head 'https://github.com/rupa/z.git'

  def install
    (prefix/'etc/profile.d').install 'z.sh'
    man1.install 'z.1'
  end

  def caveats; <<-EOS.undent
    For Bash or Zsh, put something like this in your $HOME/.bashrc or $HOME/.zshrc:
      . `brew --prefix`/etc/profile.d/z.sh

    ZSH USERS BACKWARD COMPATIBILITY WARNING:
     z now handles 'precmd' set up for zsh. z (<=1.3) users using zsh should
     remove the precmd function that was described in the installation
     instructions for previous versions.

    In short, this:
      . /path/to/z.sh
      function precmd () {
       _z --add "$(pwd -P)"
      }

    should now be:
      . `brew --prefix`/etc/profile.d/z.sh
    EOS
  end
end