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"
|
|
|
|
url "https://github.com/wting/autojump/archive/release-v22.2.4.tar.gz"
|
2015-03-18 13:02:46 +00:00
|
|
|
sha256 "816badb0721f735e2b86bdfa8b333112f3867343c7c2263c569f75b4ec91f475"
|
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
|
|
|
|
|
|
|
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
|