48 lines
1.7 KiB
Ruby
48 lines
1.7 KiB
Ruby
class Autojump < Formula
|
|
desc "Shell extension to jump to frequently used directories"
|
|
homepage "https://github.com/wting/autojump"
|
|
url "https://github.com/wting/autojump/archive/release-v22.3.2.tar.gz"
|
|
sha256 "4b644772d34323213ed6da300f53b7b70e4aa635df5b779d15dca9b38e88a64b"
|
|
|
|
head "https://github.com/wting/autojump.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "bf3f21aa2d2f11af871cce897b256e54da22d4290eee6ac1696e4f82ebc88474" => :el_capitan
|
|
sha256 "f98d8647808130d777f94ccd919bd2f46e304589766284c03d2c461f541343f5" => :yosemite
|
|
sha256 "c59a755ec00ef709819b9dcf37c0d0b0639ca61c9922f7d43af395db3a95c9d0" => :mavericks
|
|
end
|
|
|
|
def install
|
|
system "./install.py", "-d", prefix, "-z", zsh_completion
|
|
|
|
# Backwards compatibility for users that have the old path in .bash_profile
|
|
# or .zshrc
|
|
(prefix/"etc").install_symlink prefix/"etc/profile.d/autojump.sh"
|
|
|
|
libexec.install bin
|
|
bin.write_exec_script libexec/"bin/autojump"
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
Add the following line to your ~/.bash_profile or ~/.zshrc file (and remember
|
|
to source the file to update your current session):
|
|
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
|
|
|
|
If you use the Fish shell then add the following line to your ~/.config/fish/config.fish:
|
|
[ -f #{HOMEBREW_PREFIX}/share/autojump/autojump.fish ]; and source #{HOMEBREW_PREFIX}/share/autojump/autojump.fish
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
path = testpath/"foo/bar"
|
|
path.mkpath
|
|
output = %x(
|
|
source #{HOMEBREW_PREFIX}/etc/profile.d/autojump.sh
|
|
j -a "#{path.relative_path_from(testpath)}"
|
|
j foo >/dev/null
|
|
pwd
|
|
).strip
|
|
assert_equal path.realpath.to_s, output
|
|
end
|
|
end
|