5c1b341132119f08047a506e2c2b06fa0c0db52e

Author
Casey Watson <watsoncj@gmail.com>
Committer
Casey Watson <watsoncj@gmail.com>
Date

Message

Fix to random theme selection

 - themes array is 1-based

 - theme files names are located in indicies 1 through N inclusive

 - this resolves an issue where you would occasionally see: "no such
   file or directory. Random theme '' loaded..."

Diff

 1diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 2index 3ea88e9248f70f58fed084b2c274548acb902b7d..2a206798d9a4dc921ee1243d498878bc564b68c3 100644
 3--- a/oh-my-zsh.sh
 4+++ b/oh-my-zsh.sh
 5@@ -31,7 +31,7 @@ if [ "$ZSH_THEME" = "random" ]
 6 then
 7   themes=($ZSH/themes/*zsh-theme)
 8   N=${#themes[@]}
 9-  ((N=RANDOM%N))
10+  ((N=(RANDOM%N)+1))
11   RANDOM_THEME=${themes[$N]}
12   source "$RANDOM_THEME"
13   echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."