浏览代码

Oh My Zsh gets a weekly auto-updater... the future is now!

Robby Russell 15 年之前
父节点
当前提交
00a190bc01
共有 3 个文件被更改,包括 13 次插入2 次删除
  1. 9 1
      lib/misc.zsh
  2. 3 0
      templates/zshrc.zsh-template
  3. 1 1
      tools/upgrade.sh

+ 9 - 1
lib/misc.zsh

@@ -6,4 +6,12 @@ zle -N self-insert url-quote-magic
 bindkey "^[m" copy-prev-shell-word
 
 ## jobs
-setopt long_list_jobs
+setopt long_list_jobs
+
+# Check for updates on initial load...
+if [ "$DISABLE_AUTO_UPDATE" = "true" ]
+then
+  return
+else
+  /bin/sh $ZSH/tools/check_for_upgrade.sh
+fi

+ 3 - 0
templates/zshrc.zsh-template

@@ -5,6 +5,9 @@ export ZSH=$HOME/.oh-my-zsh
 # Look in ~/.oh-my-zsh/themes/
 export ZSH_THEME="robbyrussell"
 
+# Comment this out to disable weekly auto-update checks
+# export DISABLE_AUTO_UPDATE="false"
+
 source $ZSH/oh-my-zsh.sh
 
 # Customize to your needs...

+ 1 - 1
tools/upgrade.sh

@@ -1,5 +1,5 @@
 current_path=`pwd`
 echo "Upgrading Oh My Zsh"
 ( cd $ZSH && git pull origin master )
-echo "Done."
+echo "Hooray! Oh My Zsh has been updated and/or is at the current version. \nAny new updates will be reflected when you start your next terminal session."
 cd $current_path