37266112759a5759536cc4ea84ea063695cd1f2e

Author
Sébastien M-B <essembeh@gmail.com>
Committer
Sébastien M-B <essembeh@gmail.com>
Date

Message

Merge remote branch 'upstream/master'

Diff

  1diff --git a/lib/history.zsh b/lib/history.zsh
  2index ca6f57079aef8e953154aa176159c8635e333228..876936b87888a60d1fc7ece2cdfa8dcdd6d9d8c8 100644
  3--- a/lib/history.zsh
  4+++ b/lib/history.zsh
  5@@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history
  6 HISTSIZE=10000
  7 SAVEHIST=10000
  8 
  9-setopt hist_ignore_dups # ignore duplication command history list
 10-setopt share_history # share command history data
 11-
 12-setopt hist_verify
 13-setopt inc_append_history
 14+setopt append_history
 15 setopt extended_history
 16 setopt hist_expire_dups_first
 17+setopt hist_ignore_dups # ignore duplication command history list
 18 setopt hist_ignore_space
 19-
 20-setopt SHARE_HISTORY
 21-setopt APPEND_HISTORY
 22+setopt hist_verify
 23+setopt inc_append_history
 24+setopt share_history # share command history data
 25diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 26index 22e7f372fffdb1da78ffd3852130340a5d9aa448..221989502360e4182d14489765578b5ee9ff5491 100644
 27--- a/lib/termsupport.zsh
 28+++ b/lib/termsupport.zsh
 29@@ -4,7 +4,7 @@
 30 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
 31 function title {
 32   [ "$DISABLE_AUTO_TITLE" != "true" ] || return
 33-  if [[ "$TERM" == screen* ]]; then 
 34+  if [[ "$TERM" == screen* ]]; then
 35     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
 36   elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
 37     print -Pn "\e]2;$2:q\a" #set window name
 38@@ -16,14 +16,18 @@ ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
 39 ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
 40 
 41 #Appears when you have the prompt
 42-function precmd {
 43+function omz_termsupport_precmd {
 44   title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
 45 }
 46 
 47 #Appears at the beginning of (and during) of command execution
 48-function preexec {
 49+function omz_termsupport_preexec {
 50   emulate -L zsh
 51   setopt extended_glob
 52   local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 53   title "$CMD" "%100>...>$2%<<"
 54 }
 55+
 56+autoload -U add-zsh-hook
 57+add-zsh-hook precmd  omz_termsupport_precmd
 58+add-zsh-hook preexec omz_termsupport_preexec
 59diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 60index 891e8d467335aa42409b6ae331e32aaa86bcbd2b..7ae41c33e63fa1a384881d69a06119192e374cbb 100644
 61--- a/oh-my-zsh.sh
 62+++ b/oh-my-zsh.sh
 63@@ -13,20 +13,27 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
 64 # TIP: Add files you don't want in git to .gitignore
 65 for config_file ($ZSH/lib/*.zsh) source $config_file
 66 
 67-# Add all defined plugins to fpath
 68+# Set ZSH_CUSTOM to the path where your custom config files
 69+# and plugins exists, or else we will use the default custom/
 70+if [[ -z "$ZSH_CUSTOM" ]]; then
 71+    ZSH_CUSTOM="$ZSH/custom"
 72+fi
 73+
 74+# Add all defined plugins to fpath. This must be done
 75+# before running compinit.
 76 plugin=${plugin:=()}
 77-for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
 78+for plugin ($plugins); do
 79+  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
 80+    fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
 81+  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
 82+    fpath=($ZSH/plugins/$plugin $fpath)
 83+  fi
 84+done
 85 
 86 # Load and run compinit
 87 autoload -U compinit
 88 compinit -i
 89 
 90-# Set ZSH_CUSTOM to the path where your custom config files
 91-# and plugins exists, or else we will use the default custom/
 92-if [ "$ZSH_CUSTOM" = ""  ]
 93-then
 94-    ZSH_CUSTOM="$ZSH/custom"
 95-fi
 96 
 97 # Load all of the plugins that were defined in ~/.zshrc
 98 for plugin ($plugins); do
 99diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
100index da0a1276572dc655cc82eedc762e2996dac8b0b6..6f9b80bffa077a9928ba2a2b7647b96c7588a3f1 100644
101--- a/plugins/autojump/autojump.plugin.zsh
102+++ b/plugins/autojump/autojump.plugin.zsh
103@@ -1,3 +1,5 @@
104-if [ -f `brew --prefix`/etc/autojump ]; then
105+if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
106+  . /opt/local/etc/profile.d/autojump.sh
107+elif [ -f `brew --prefix`/etc/autojump ]; then
108   . `brew --prefix`/etc/autojump
109 fi
110diff --git a/plugins/pip/_pip b/plugins/pip/_pip
111index b58010173a5028b0dc0db651f042e56df861d497..df53ba5ce8ec788d3ff7da94a9936ffee94267db 100644
112--- a/plugins/pip/_pip
113+++ b/plugins/pip/_pip
114@@ -3,30 +3,43 @@
115 
116 # pip zsh completion, based on homebrew completion
117 
118+_pip_all() {
119+  # we cache the list of packages (originally from the macports plugin)
120+  if (( ! $+piplist )); then
121+    echo -n " (caching package index...)"
122+	piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
123+  fi
124+}
125+
126 _pip_installed() {
127-  installed_pkgs=(`pip freeze`)
128+  installed_pkgs=(`pip freeze | cut -d '=' -f 1`)
129 }
130 
131 local -a _1st_arguments
132 _1st_arguments=(
133-  'bundle:Create pybundles (archives containing multiple packages)'
134-  'freeze:Output all currently installed packages (exact versions) to stdout'
135-  'help:Show available commands'
136-  'install:Install packages'
137-  'search:Search PyPI'
138-  'uninstall:Uninstall packages'
139-  'unzip:Unzip individual packages'
140-  'zip:Zip individual packages'
141+  'bundle:create pybundles (archives containing multiple packages)'
142+  'freeze:output all currently installed packages (exact versions) to stdout'
143+  'help:show available commands'
144+  'install:install packages'
145+  'search:search PyPI'
146+  'uninstall:uninstall packages'
147+  'unzip:unzip individual packages'
148+  'zip:zip individual packages'
149 )
150 
151 local expl
152-local -a pkgs installed_pkgs
153+local -a all_pkgs installed_pkgs
154 
155 _arguments \
156-  '(--version)--version[Show version number of program and exit]' \
157-  '(-v --verbose)'{-v,--verbose}'[Give more output]' \
158-  '(-q --quiet)'{-q,--quiet}'[Give less output]' \
159-  '(-h --help)'{-h,--help}'[Show help]' \
160+  '(--version)--version[show version number of program and exit]' \
161+  '(-h --help)'{-h,--help}'[show help]' \
162+  '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \
163+  '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \
164+  '(-v --verbose)'{-v,--verbose}'[give more output]' \
165+  '(-q --quiet)'{-q,--quiet}'[give less output]' \
166+  '(--log)--log[log file location]' \
167+  '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \
168+  '(--timeout)--timeout[socket timeout (default 15s)]' \
169   '*:: :->subcmds' && return 0
170 
171 if (( CURRENT == 1 )); then
172@@ -35,10 +48,25 @@ if (( CURRENT == 1 )); then
173 fi
174 
175 case "$words[1]" in
176-  list)
177-      if [[ "$state" == forms ]]; then
178-        _pip_installed
179-        _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
180+  search)
181+    _arguments \
182+      '(--index)--index[base URL of Python Package Index]' ;;
183+  freeze)
184+    _arguments \
185+      '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;;
186+  install)
187+  	_arguments \
188+      '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
189+      '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
190+      '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \
191+      '(--no-install)--no-install[only download packages]' \
192+      '(--no-download)--no-download[only install downloaded packages]' \
193+      '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \
194+      '1: :->packages' &&  return 0
195+     
196+      if [[ "$state" == packages ]]; then
197+        _pip_all
198+        _wanted piplist expl 'packages' compadd -a piplist
199       fi ;;
200   uninstall)
201     _pip_installed
202diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
203index f4ee637e6b45522afdee404804b12edf0f1e992e..792cde2bd07b472d55c41393439a3306288db7cb 100644
204--- a/plugins/rails3/rails3.plugin.zsh
205+++ b/plugins/rails3/rails3.plugin.zsh
206@@ -17,3 +17,5 @@ alias rp='_rails_command plugin'
207 alias rs='_rails_command server'
208 alias rsd='_rails_command server --debugger'
209 alias devlog='tail -f log/development.log'
210+alias rdm='rake db:migrate'
211+alias rdr='rake db:rollback'
212diff --git a/plugins/wakeonlan/README b/plugins/wakeonlan/README
213new file mode 100644
214index 0000000000000000000000000000000000000000..16fdd4587060ce16895373d3bd5e9713113994c3
215--- /dev/null
216+++ b/plugins/wakeonlan/README
217@@ -0,0 +1,29 @@
218+This plugin provides a wrapper around the "wakeonlan" tool available from most
219+distributions' package repositories, or from the following website:
220+
221+http://gsd.di.uminho.pt/jpo/software/wakeonlan/
222+
223+In order to use this wrapper, create the ~/.wakeonlan directory, and place in
224+that directory one file for each device you would like to be able to wake. Give
225+the file a name that describes the device, such as its hostname. Each file
226+should contain a line with the mac address of the target device and the network
227+broadcast address.
228+
229+For instance, there might be a file ~/.wakeonlan/leto with the following
230+contents:
231+
232+00:11:22:33:44:55:66 192.168.0.255
233+
234+To wake that device, use the following command:
235+
236+# wake leto
237+
238+The available device names will be autocompleted, so:
239+
240+# wake <tab>
241+
242+...will suggest "leto", along with any other configuration files that were
243+placed in the ~/.wakeonlan directory.
244+
245+For more information regarding the configuration file format, check the
246+wakeonlan man page.
247diff --git a/plugins/wakeonlan/_wake b/plugins/wakeonlan/_wake
248new file mode 100644
249index 0000000000000000000000000000000000000000..4ab10d374a6e5d82d953d3d32b5f2ade2ec9ddd6
250--- /dev/null
251+++ b/plugins/wakeonlan/_wake
252@@ -0,0 +1,4 @@
253+#compdef wake
254+#autoload
255+
256+_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0
257diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh
258new file mode 100644
259index 0000000000000000000000000000000000000000..6cef7d44ad72f59690093b6e13cdd95d629cff69
260--- /dev/null
261+++ b/plugins/wakeonlan/wakeonlan.plugin.zsh
262@@ -0,0 +1,14 @@
263+function wake() {
264+  local config_file="$HOME/.wakeonlan/$1"
265+  if [[ ! -f "$config_file" ]]; then
266+    echo "ERROR: There is no configuration file at \"$config_file\"."
267+    return 1
268+  fi
269+
270+  if (( ! $+commands[wakeonlan] )); then
271+    echo "ERROR: Can't find \"wakeonlan\".  Are you sure it's installed?"
272+    return 1
273+  fi
274+
275+  wakeonlan -f "$config_file"
276+}
277diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme
278index 92f1df941e7c0f027b78df4b86ebeeb7db4b82b3..275341dc67a8d85caafe92d78ab414787f104cdc 100644
279--- a/themes/apple.zsh-theme
280+++ b/themes/apple.zsh-theme
281@@ -2,7 +2,7 @@ function toon {
282   echo -n ""
283 }
284 
285-get_git_dirty() { 
286+get_git_dirty() {
287   git diff --quiet || echo '*'
288 }
289 
290@@ -18,9 +18,12 @@ zstyle ':vcs_info:*' formats       \
291 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
292 zstyle ':vcs_info:*' enable git cvs svn
293 
294-precmd () {
295+theme_precmd () {
296     vcs_info
297 }
298 
299 setopt prompt_subst
300 PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
301+
302+autoload -U add-zsh-hook
303+add-zsh-hook precmd theme_precmd
304diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
305index 259640ba40cdee547cc8826126dae6f9e4a9d748..f9406dd966d1132f556ad3cb120b4a542cdd88d8 100644
306--- a/themes/gallois.zsh-theme
307+++ b/themes/gallois.zsh-theme
308@@ -14,6 +14,8 @@ git_custom_status() {
309 #RVM and git settings
310 if [[ -s ~/.rvm/scripts/rvm ]] ; then 
311   RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
312+else
313+  RPS1='$(git_custom_status) $EPS1'
314 fi
315 
316 PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
317diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
318index add485279cfcc0df29817e1cabc8b8224e9948af..a170a13d0b435e835244c1cb945dbf07f4474beb 100644
319--- a/themes/jonathan.zsh-theme
320+++ b/themes/jonathan.zsh-theme
321@@ -1,19 +1,19 @@
322-function precmd {
323+function theme_precmd {
324     local TERMWIDTH
325     (( TERMWIDTH = ${COLUMNS} - 1 ))
326 
327 
328     ###
329     # Truncate the path if it's too long.
330-    
331+
332     PR_FILLBAR=""
333     PR_PWDLEN=""
334-    
335+
336     local promptsize=${#${(%):---(%n@%m:%l)---()--}}
337     local rubyprompt=`rvm_prompt_info`
338     local rubypromptsize=${#${rubyprompt}}
339     local pwdsize=${#${(%):-%~}}
340-    
341+
342     if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then
343       ((PR_PWDLEN=$TERMWIDTH - $promptsize))
344     else
345@@ -24,7 +24,7 @@ function precmd {
346 
347 
348 setopt extended_glob
349-preexec () {
350+theme_preexec () {
351     if [[ "$TERM" == "screen" ]]; then
352 	local CMD=${1[(wr)^(*=*|sudo|-*)]}
353 	echo -n "\ek$CMD\e\\"
354@@ -69,7 +69,7 @@ setprompt () {
355 
356     ###
357     # See if we can use extended characters to look nicer.
358-    
359+
360     typeset -A altchar
361     set -A altchar ${(s..)terminfo[acsc]}
362     PR_SET_CHARSET="%{$terminfo[enacs]%}"
363@@ -81,10 +81,10 @@ setprompt () {
364     PR_LRCORNER=${altchar[j]:--}
365     PR_URCORNER=${altchar[k]:--}
366 
367-    
368+
369     ###
370     # Decide if we need to set titlebar text.
371-    
372+
373     case $TERM in
374 	xterm*)
375 	    PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
376@@ -96,8 +96,8 @@ setprompt () {
377 	    PR_TITLEBAR=''
378 	    ;;
379     esac
380-    
381-    
382+
383+
384     ###
385     # Decide whether to set a screen title
386     if [[ "$TERM" == "screen" ]]; then
387@@ -105,8 +105,8 @@ setprompt () {
388     else
389 	PR_STITLE=''
390     fi
391-    
392-    
393+
394+
395     ###
396     # Finally, the prompt.
397 
398@@ -135,3 +135,7 @@ $PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR '
399 }
400 
401 setprompt
402+
403+autoload -U add-zsh-hook
404+add-zsh-hook precmd  theme_precmd
405+add-zsh-hook preexec theme_preexec
406diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme
407index 6e04e1595aa4d0d0dfc96f1961bfb756252ed9f4..e743289c35aff6561f519b4702c5b070df08320a 100644
408--- a/themes/kolo.zsh-theme
409+++ b/themes/kolo.zsh-theme
410@@ -7,7 +7,7 @@ zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
411 zstyle ':vcs_info:*' check-for-changes true
412 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
413 zstyle ':vcs_info:*' enable git svn
414-precmd () {
415+theme_precmd () {
416     if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
417         zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
418     } else {
419@@ -19,3 +19,6 @@ precmd () {
420 
421 setopt prompt_subst
422 PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% '
423+
424+autoload -U add-zsh-hook
425+add-zsh-hook precmd  theme_precmd
426diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme
427new file mode 100644
428index 0000000000000000000000000000000000000000..cf3bb908f217a9ed67228963609306da6aa8065d
429--- /dev/null
430+++ b/themes/pygmalion.zsh-theme
431@@ -0,0 +1,9 @@
432+# Yay! High voltage and arrows!
433+
434+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
435+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
436+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
437+ZSH_THEME_GIT_PROMPT_CLEAN=""
438+
439+PROMPT='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%}  '
440+
441diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme
442new file mode 100644
443index 0000000000000000000000000000000000000000..f50657db2c909def178fa5762def0f9ab613157d
444--- /dev/null
445+++ b/themes/suvash.zsh-theme
446@@ -0,0 +1,23 @@
447+function prompt_char {
448+    git branch >/dev/null 2>/dev/null && echo '±' && return
449+    hg root >/dev/null 2>/dev/null && echo 'Hg' && return
450+    echo '○'
451+}
452+
453+function virtualenv_info {
454+    [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
455+}
456+
457+function collapse_pwd {
458+    echo $(pwd | sed -e "s,^$HOME,~,")
459+}
460+
461+PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) using %{$reset_color%}%{$fg[red]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} 
462+$(virtualenv_info)$(prompt_char) '
463+
464+
465+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
466+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
467+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
468+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
469+ZSH_THEME_GIT_PROMPT_CLEAN=""
470diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
471new file mode 100644
472index 0000000000000000000000000000000000000000..6c056dfbea855d4cb5eb3550bf9a742fbb0ed873
473--- /dev/null
474+++ b/themes/zhann.zsh-theme
475@@ -0,0 +1,7 @@
476+PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
477+RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v) %{$reset_color%}'
478+
479+ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
480+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
481+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
482+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
483diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
484index aeaa0e415f496a7b0d895efe582833bb9f87dc2d..524aa509d5bf5525ecc6b4e5ac3e879e1b5fb98b 100644
485--- a/tools/check_for_upgrade.sh
486+++ b/tools/check_for_upgrade.sh
487@@ -8,6 +8,12 @@ function _update_zsh_update() {
488   echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update
489 }
490 
491+function _upgrade_zsh() {
492+  /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
493+  # update the zsh file
494+  _update_zsh_update
495+}
496+
497 if [ -f ~/.zsh-update ]
498 then
499   . ~/.zsh-update
500@@ -19,17 +25,21 @@ then
501   epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
502   if [ $epoch_diff -gt 6 ]
503   then
504-    echo "[Oh My Zsh] Would you like to check for updates?"
505-    echo "Type Y to update oh-my-zsh: \c"
506-    read line
507-    if [ "$line" = Y ] || [ "$line" = y ]
508+    if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
509     then
510-      /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
511-      # update the zsh file
512-      _update_zsh_update
513+      _upgrade_zsh
514+    else
515+      echo "[Oh My Zsh] Would you like to check for updates?"
516+      echo "Type Y to update oh-my-zsh: \c"
517+      read line
518+      if [ "$line" = Y ] || [ "$line" = y ]
519+      then
520+        _upgrade_zsh
521+      fi
522     fi
523   fi
524 else
525   # create the zsh file
526   _update_zsh_update
527 fi
528+