Permalink
Browse files

Merge branch 'master' of github.com:zsh-users/antigen

  • Loading branch information...
2 parents dbdac1a + b7d2d3e commit a8ea6fb4949d21afe019d637bbaa1741d595e20b @sharat87 sharat87 committed Mar 13, 2013
Showing with 15 additions and 11 deletions.
  1. +1 −1 README.mkd
  2. +14 −10 antigen.zsh
View
@@ -53,7 +53,7 @@ it). Just a bundle command away.
antigen-bundle sharat87/autoenv
And boom! you have all the autoenv goodness. Just remember how you used to do
-these before antigen, clone it, modify your bashrc to source it, load a new
+these before antigen, clone it, modify your zshrc to source it, load a new
terminal, all just to test it out. Duh!
A subtle aspect of this is that you can tell antigen to grab just about anything
View
@@ -130,18 +130,22 @@ antigen-update () {
}
antigen-revert () {
- if ! [[ -f $ADOTDIR/revert-info ]]; then
+ if [[ -f $ADOTDIR/revert-info ]]; then
+ cat $ADOTDIR/revert-info | sed '1!p' | while read line; do
+ dir="$(echo "$line" | cut -d: -f1)"
+ git --git-dir="$dir/.git" --work-tree="$dir" \
+ checkout "$(echo "$line" | cut -d: -f2)" 2> /dev/null
+
+ done
+
+ echo "Reverted to state before running -update on $(
+ cat $ADOTDIR/revert-info | sed -n 1p)."
+
+ else
echo 'No revert information available. Cannot revert.' >&2
fi
- cat $ADOTDIR/revert-info | sed '1!p' | while read line; do
- dir="$(echo "$line" | cut -d: -f1)"
- git --git-dir="$dir/.git" --work-tree="$dir" \
- checkout "$(echo "$line" | cut -d: -f2)" 2> /dev/null
- done
- echo "Reverted to state before running -update on $(
- cat $ADOTDIR/revert-info | sed -n 1p)."
}
-antigen-get-clone-dir () {
@@ -229,7 +233,7 @@ antigen-revert () {
--plugin-git checkout $requested_branch
fi
- if ! [[ -z $old_rev || $old_rev == $new_rev ]]; then
+ if [[ -n $old_rev && $old_rev != $new_rev ]]; then
echo Updated from ${old_rev:0:7} to ${new_rev:0:7}.
if $verbose; then
--plugin-git log --oneline --reverse --no-merges --stat '@{1}..'
@@ -548,7 +552,7 @@ antigen () {
# Set spec values based on the positional arguments.
local i=1
- while ! [[ -z $1 || $1 == --* ]]; do
+ while [[ -n $1 && $1 != --* ]]; do
if (( $i > $positional_args_count )); then
echo "Only $positional_args_count positional arguments allowed." >&2

0 comments on commit a8ea6fb

Please sign in to comment.