2012-01-11 04:05:04 +00:00
|
|
|
class Autojump < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Shell extension to jump to frequently used directories"
|
2015-07-22 13:19:13 +00:00
|
|
|
homepage "https://github.com/wting/autojump"
|
2016-02-10 01:01:17 +00:00
|
|
|
url "https://github.com/wting/autojump/archive/release-v22.3.0.tar.gz"
|
|
|
|
sha256 "800f444b820b3a985e1da2d183fb5e2e23753a2ade53d6e1195678c650379a03"
|
2012-01-11 04:05:04 +00:00
|
|
|
|
2015-07-22 13:19:13 +00:00
|
|
|
head "https://github.com/wting/autojump.git"
|
2012-01-11 04:05:04 +00:00
|
|
|
|
2016-02-10 01:14:01 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "b1d061456b911c1a36216ee3e6569a73aad5e1e9994fb0ba515715a43675811e" => :el_capitan
|
|
|
|
sha256 "08e603c2689a7ac96839cdd6b02f1c1b1803e50598dcd5eaef73d5b7d9275bc6" => :yosemite
|
|
|
|
sha256 "374c3703dab50849119b2d511eeca5fa7523df903fa2ae34acf334c229343182" => :mavericks
|
|
|
|
end
|
|
|
|
|
2012-01-11 04:05:04 +00:00
|
|
|
def install
|
2015-01-26 19:32:47 +00:00
|
|
|
system "./install.py", "-d", prefix, "-z", zsh_completion
|
2014-01-08 07:58:34 +00:00
|
|
|
|
2015-01-26 19:32:47 +00:00
|
|
|
# Backwards compatibility for users that have the old path in .bash_profile
|
|
|
|
# or .zshrc
|
|
|
|
(prefix/"etc").install_symlink prefix/"etc/profile.d/autojump.sh"
|
2014-10-24 18:04:58 +00:00
|
|
|
|
2015-01-26 19:32:47 +00:00
|
|
|
libexec.install bin
|
|
|
|
bin.write_exec_script libexec/"bin/autojump"
|
2012-01-11 04:05:04 +00:00
|
|
|
end
|
|
|
|
|
2014-12-18 10:19:54 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2012-11-01 09:41:44 +00:00
|
|
|
Add the following line to your ~/.bash_profile or ~/.zshrc file (and remember
|
|
|
|
to source the file to update your current session):
|
2015-01-26 19:32:47 +00:00
|
|
|
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
|
2013-07-31 15:12:27 +00:00
|
|
|
|
2015-01-26 19:32:47 +00:00
|
|
|
If you use the Fish shell then add the following line to your ~/.config/fish/config.fish:
|
2015-01-28 18:45:30 +00:00
|
|
|
[ -f #{HOMEBREW_PREFIX}/share/autojump/autojump.fish ]; and . #{HOMEBREW_PREFIX}/share/autojump/autojump.fish
|
2014-12-18 10:19:54 +00:00
|
|
|
EOS
|
|
|
|
end
|
2013-07-31 15:12:27 +00:00
|
|
|
|
2014-12-18 10:19:54 +00:00
|
|
|
test do
|
|
|
|
path = testpath/"foo"
|
|
|
|
path.mkdir
|
2015-01-26 19:32:47 +00:00
|
|
|
output = %x(
|
|
|
|
source #{HOMEBREW_PREFIX}/etc/profile.d/autojump.sh
|
2014-12-18 10:19:54 +00:00
|
|
|
j -a foo
|
|
|
|
j foo >/dev/null
|
|
|
|
pwd
|
2015-01-26 19:32:47 +00:00
|
|
|
).strip
|
2014-12-18 10:19:54 +00:00
|
|
|
assert_equal path.to_s, output
|
2012-01-11 04:05:04 +00:00
|
|
|
end
|
|
|
|
end
|