2011-03-10 05:11:03 +00:00
|
|
|
class Cdargs < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Bookmarks for the shell"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "http://www.skamphausen.de/cgi-bin/ska/CDargs"
|
|
|
|
url "http://www.skamphausen.de/downloads/cdargs/cdargs-1.35.tar.gz"
|
|
|
|
sha256 "ee35a8887c2379c9664b277eaed9b353887d89480d5749c9ad957adf9c57ed2c"
|
2010-01-11 00:37:09 +00:00
|
|
|
|
2015-10-12 18:56:22 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "de9d5777eb0179f9ffacb5bcbb0ff0ce7f0c1fb208bb992290eb5a36e1d3f159" => :el_capitan
|
|
|
|
sha256 "cf098fc4187835ef1c970b38ab41719e0900c01d2772572f697e9773a6c632e6" => :yosemite
|
|
|
|
sha256 "2bb555d4cf65f3d11595350135582599fd6ccf988bc7bb76c58155ddcef29223" => :mavericks
|
|
|
|
end
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2334
|
|
|
|
cause "Bus error in ld on SL 10.6.4"
|
|
|
|
end
|
2010-08-09 23:57:35 +00:00
|
|
|
|
2011-01-25 14:36:02 +00:00
|
|
|
# fixes zsh usage using the patch provided at the cdargs homepage
|
|
|
|
# (See http://www.skamphausen.de/cgi-bin/ska/CDargs)
|
2014-03-18 17:13:30 +00:00
|
|
|
patch :DATA
|
2011-01-25 14:36:02 +00:00
|
|
|
|
2011-03-21 21:24:22 +00:00
|
|
|
def install
|
2010-02-15 22:51:38 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
|
2010-01-11 00:37:09 +00:00
|
|
|
system "make"
|
2015-10-05 12:40:09 +00:00
|
|
|
system "make", "install-strip"
|
2010-01-11 00:37:09 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
rm Dir["contrib/Makefile*"]
|
|
|
|
prefix.install "contrib"
|
2013-05-03 18:03:31 +00:00
|
|
|
bash_completion.install_symlink "#{prefix}/contrib/cdargs-bash.sh"
|
2010-01-11 00:37:09 +00:00
|
|
|
end
|
|
|
|
|
2011-01-25 14:36:02 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2012-07-18 08:22:00 +00:00
|
|
|
Support files for bash, tcsh, and emacs have been installed to:
|
2011-01-25 14:36:02 +00:00
|
|
|
#{prefix}/contrib
|
2010-01-11 00:37:09 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
2011-01-25 14:36:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/contrib/cdargs-bash.sh b/contrib/cdargs-bash.sh
|
|
|
|
index 8a197ef..f3da067 100644
|
|
|
|
--- a/contrib/cdargs-bash.sh
|
|
|
|
+++ b/contrib/cdargs-bash.sh
|
|
|
|
@@ -11,6 +11,12 @@
|
|
|
|
CDARGS_SORT=0 # set to 1 if you want mark to sort the list
|
|
|
|
CDARGS_NODUPS=1 # set to 1 if you want mark to delete dups
|
|
|
|
|
|
|
|
+# Support ZSH via its BASH completion emulation
|
|
|
|
+if [ -n "$ZSH_VERSION" ]; then
|
|
|
|
+ autoload bashcompinit
|
|
|
|
+ bashcompinit
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
# --------------------------------------------- #
|
|
|
|
# Run the cdargs program to get the target #
|
|
|
|
# directory to be used in the various context #
|
|
|
|
@@ -166,7 +172,7 @@ function mark ()
|
|
|
|
local tmpfile
|
|
|
|
|
|
|
|
# first clear any bookmarks with this same alias, if file exists
|
|
|
|
- if [[ "$CDARGS_NODUPS" && -e "$HOME/.cdargs" ]]; then
|
|
|
|
+ if [ "$CDARGS_NODUPS" ] && [ -e "$HOME/.cdargs" ]; then
|
|
|
|
tmpfile=`echo ${TEMP:-${TMPDIR:-/tmp}} | sed -e "s/\\/$//"`
|
|
|
|
tmpfile=$tmpfile/cdargs.$USER.$$.$RANDOM
|
|
|
|
grep -v "^$1 " "$HOME/.cdargs" > $tmpfile && 'mv' -f $tmpfile "$HOME/.cdargs";
|