Permalink
Browse files

Fix zsh breakages

  • Loading branch information...
1 parent d7103fb commit f7301015115f7c77c2f33d3f743c7b8b8e598419 @tpope tpope committed Mar 1, 2012
Showing with 3 additions and 8 deletions.
  1. +3 −8 .hashrc
View
11 .hashrc
@@ -17,11 +17,6 @@ for dir in /usr/local/sbin /opt/local/sbin; do
esac
done
-SOURCE="${BASH_SOURCE[0]}"
-[ -e "$SOURCE" ] || SOURCE="$0"
-while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
-DOTMATRIX_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
hcd() {
cd "$HASHROCKET_DIR/$1"
}
@@ -218,7 +213,7 @@ setup_tmux_pasteboard () {
#
# $ atomically rake
atomically () {
- $DOTMATRIX_DIR/bin/atomically $@
+ $HASHROCKET_DIR/dotmatrix/bin/atomically $@
}
# git_prompt_info accepts 0 or 1 arguments (i.e., format string)
@@ -306,5 +301,5 @@ alias reset-authors='git commit --amend --reset-author -C HEAD'
alias vi='vim'
bettervim="/Applications/MacVim.app/Contents/MacOS/Vim"
-[[ -f "$bettervim" ]] && alias vim="$bettervim"
-[[ -f "$HOME$bettervim" ]] && alias vim="$HOME$bettervim"
+[ -f "$bettervim" ] && alias vim="$bettervim"
@jgdavey

jgdavey Apr 11, 2012

Contributor

I've seen mixed things on the internets about using [ (test) vs [[, and was under the impression that [[ was the best practice. What about the double brackets breaks zsh here?

+[ -f "$HOME$bettervim" ] && alias vim="$HOME$bettervim"

2 comments on commit f730101

Collaborator

tpope replied Apr 11, 2012

I wish I could remember a full month back. Not sure if it was an actual breakage or (more likely) me just bikeshedding.

I tend to favor single brackets just because they're ubiquitous. I've been burned too many times when I've suddenly found myself trying to run code on ash (popular on embedded systems), dash (/bin/sh is actually this on Debian), or even ksh (Solaris anyone?).

Contributor

jgdavey replied Apr 11, 2012

Please sign in to comment.