Skip to content

Commit

Permalink
cdargs: fix patch
Browse files Browse the repository at this point in the history
  • Loading branch information
fxcoudert committed Oct 24, 2019
1 parent 18397c9 commit 9212f63
Showing 1 changed file with 4 additions and 29 deletions.
33 changes: 4 additions & 29 deletions Formula/cdargs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ class Cdargs < Formula

# fixes zsh usage using the patch provided at the cdargs homepage
# (See https://www.skamphausen.de/cgi-bin/ska/CDargs)
patch :DATA
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/85fa66a9/cdargs/1.35.patch"
sha256 "adb4e73f6c5104432928cd7474a83901fe0f545f1910b51e4e81d67ecef80a96"
end

def install
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
Expand All @@ -40,31 +43,3 @@ def caveats
system "#{bin}/cdargs", "--version"
end
end

__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";

0 comments on commit 9212f63

Please sign in to comment.