Commit 96ff8614 authored by Andrew Janke's avatar Andrew Janke
Browse files

Merge branch 'master' into installer-cygwin-support-3

Conflicts:
	tools/install.sh
parents 502f08b5 76a26a2a
...@@ -18,4 +18,11 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" ...@@ -18,4 +18,11 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_CLEAN=""
RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}' if [ -e ~/.rvm/bin/rvm-prompt ]; then
RPROMPT='%{$fg_bold[red]%}‹$(~/.rvm/bin/rvm-prompt i v)›%{$reset_color%}'
else
if which rbenv &> /dev/null; then
RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}'
fi
fi
...@@ -13,7 +13,7 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset ...@@ -13,7 +13,7 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-HOST} [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
} }
PROMPT=' PROMPT='
......
# Based on evan's prompt # Based on evan's prompt
# Shows the exit status of the last command if non-zero # Shows the exit status of the last command if non-zero
# Uses "#" instead of "»" when running with elevated privileges # Uses "#" instead of "»" when running with elevated privileges
PROMPT="%m %{${fg_bold[red]}%}:: %{${fg[green]}%}%3~%(0?. . ${fg[red]}%? )%{${fg[blue]}%}»%{${reset_color}%} " PROMPT="%m %{${fg_bold[red]}%}:: %{${fg[green]}%}%3~%(0?. . %{${fg[red]}%}%? )%{${fg[blue]}%}»%{${reset_color}%} "
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} ओम् %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info) PROMPT='%{$fg[blue]%}%m%{$reset_color%}%{$fg_bold[white]%} %{$reset_color%}%{$fg[cyan]%}%~:%{$reset_color%}$(git_time_since_commit)$(git_prompt_info)
%{$fg[red]%}%!%{$reset_color%} $(prompt_char) ' %{$fg[red]%}%!%{$reset_color%} $(prompt_char) '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}git%{$reset_color%}@%{$bg[white]%}%{$fg[black]%}"
......
#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
# FILE: emotty.zsh-theme
# DESCRIPTION: A varying emoji based theme
# AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
# VERSION: 1.0.0
# DEPENDS: emotty plugin
# RECOMMENDS: Hasklig font
#
# This theme shows a different emoji for each tty at the main prompt.
#
# There are pre-defined different emoji sets to choose from, e.g.:
# emoji, stellar, floral, zodiac, love (see emotty plugin).
#
# To choose a different emotty set than the default (emoji)
# % export emotty_set=nature
#
# For the superuser (root) this theme shows a designated indicator
# and switches the foreground color to red
# (see root_prompt variable, default: skull).
# But you are using sudo (8) instead of designated a root shell, right‽
#
# When logged in via SSH the main prompt also shows the user- and hostname.
#
# The exit status of the last failed command is displayed in the window title
# along with an indicator (see warn_glyph variable, default: collision symbol).
# To clear it just run: $NULL, true or :
#
# The right prompt shows the current working directory (3 levels up) in cyan.
#
# When in a git repository the main prompt shows the current branch name
# with a branch indicator in yellow
# (see vcs_branch_glyph variable, default: Hasklig branch glyph).
#
# If there are modified files the prompt switches to red and shows an unstaged
# indicator (see vcs_unstaged_glyph variable, default: circled letter M).
#
# If there are staged files the prompt switches to green and shows an staged
# indicator (see vcs_staged_glyph variable, default: high voltage sign).
#
# In a git repository the right prompt shows the repository name in bold and
# prepends the current working directory subpath within the repository.
#
# When git currently performs an action such as merge or rebase, the action is
# displayed in red instead of the branch name and a special action indicator
# is shown (see vcs_action_glyph variable, default: chevron).
# ------------------------------------------------------------------------------
user_prompt="$(emotty)"
root_prompt="$emoji[skull]"
warn_prompt="$emoji[collision_symbol]"
vcs_unstaged_glyph="%{$emoji[circled_latin_capital_letter_m]$emoji2[emoji_style] %2G%}"
vcs_staged_glyph="%{$emoji[high_voltage_sign] %2G%}"
vcs_branch_glyph=$(print -P $'\Ue0a0') # 
vcs_action_glyph=$(print -P $'\U276f') # ❯
red="$FG[001]"
yellow="$FG[003]"
green="$FG[002]"
cyan="$FG[014]"
prompt_glyph="%{%(#.${root_prompt}.${user_prompt}) %2G%}"
# Uncomment the next line if you also like to see the warn_prompt in the prompt on the right.
#last_command_failed="%(?.. %F{red}%1{${warn_prompt} %1G%}%?%f)"
setopt promptsubst
autoload -U add-zsh-hook
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git #hg svn cvs
zstyle ':vcs_info:*' get-revision false
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:git:*' unstagedstr "${red}${vcs_unstaged_glyph}"
zstyle ':vcs_info:*' stagedstr "${green}${vcs_staged_glyph}"
# %(K|F){color} set (back|fore)ground color
# %(k|f) reset (back|fore)ground color
zstyle ':vcs_info:*' max-exports 3
zstyle ':vcs_info:*' nvcsformats "${prompt_glyph}" '%3~' ''
zstyle ':vcs_info:*' formats "${yellow}%u%c%b${vcs_branch_glyph}%f" '%S|' "$FX[bold]%r$FX[no-bold]"
zstyle ':vcs_info:*' actionformats "${red}%K{white}%a${vcs_action_glyph}%k%f" '%S|' "$FX[bold]%r$FX[no-bold]"
red_if_root="%(!.%F{red}.)"
sshuser_on_host="${SSH_TTY:+%(!.$red.$yellow)%n@%m$reset_color}"
PROMPT='${sshuser_on_host}${vcs_info_msg_0_}${red_if_root} '
RPROMPT='${cyan}${vcs_info_msg_1_##.|}${vcs_info_msg_2_}%f${last_command_failed}'
emotty_title() {
title "${${?/[^0]*/$warn_prompt $?}/0/${prompt_glyph}}"
}
add-zsh-hook precmd emotty_title
add-zsh-hook precmd vcs_info
# vim:ft=zsh ts=2 sw=2 sts=2
...@@ -21,7 +21,7 @@ function prompt_char { ...@@ -21,7 +21,7 @@ function prompt_char {
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-HOST} [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
} }
......
...@@ -17,7 +17,7 @@ function prompt_char { ...@@ -17,7 +17,7 @@ function prompt_char {
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-HOST} [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
} }
local ruby_env='' local ruby_env=''
......
# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png # ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png
# Based on bira theme # Based on bira theme
# load some modules
autoload -U zsh/terminfo # Used in the colour alias below
setopt prompt_subst setopt prompt_subst
# make some aliases for the colours: (could use normal escape sequences too) () {
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$fg[${(L)color}]%}' local PR_USER PR_USER_OP PR_PROMPT PR_HOST
done
eval PR_NO_COLOR="%{$terminfo[sgr0]%}"
eval PR_BOLD="%{$terminfo[bold]%}"
# Check the UID # Check the UID
if [[ $UID -ne 0 ]]; then # normal user if [[ $UID -ne 0 ]]; then # normal user
eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' PR_USER='%F{green}%n%f'
eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' PR_USER_OP='%F{green}%#%f'
local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' PR_PROMPT='%f➤ %f'
else # root else # root
eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' PR_USER='%F{red}%n%f'
eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' PR_USER_OP='%F{red}%#%f'
local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' PR_PROMPT='%F{red}➤ %f'
fi fi
# Check if we are on SSH or not # Check if we are on SSH or not
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then
eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH PR_HOST='%F{red}%M%f' # SSH
else else
eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH PR_HOST='%F{green}%M%f' # no SSH
fi fi
local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' local return_code="%(?..%F{red}%? ↵%f)"
local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}'
local user_host="${PR_USER}%F{cyan}@${PR_HOST}"
local current_dir="%B%F{blue}%~%f%b"
local rvm_ruby='' local rvm_ruby=''
if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect local user rvm installation if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect user-local rvm installation
rvm_ruby='%{$PR_RED%}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%{$PR_NO_COLOR%}' rvm_ruby='%F{red}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%f'
elif which rvm-prompt &> /dev/null; then # detect sysem-wide rvm installation elif which rvm-prompt &> /dev/null; then # detect system-wide rvm installation
rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' rvm_ruby='%F{red}‹$(rvm-prompt i v g s)›%f'
elif which rbenv &> /dev/null; then # detect Simple Ruby Version management elif which rbenv &> /dev/null; then # detect Simple Ruby Version Management
rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' rvm_ruby='%F{red}‹$(rbenv version | sed -e "s/ (set.*$//")›%f'
fi fi
local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' local git_branch='$(git_prompt_info)'
#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT "
PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
╰─$PR_PROMPT " ╰─$PR_PROMPT "
RPS1="${return_code}" RPROMPT="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %f"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" }
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}"
...@@ -59,16 +59,17 @@ ZSH_THEME_GIT_PROMPT_PREFIX="" ...@@ -59,16 +59,17 @@ ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="" ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" ZSH_THEME_GIT_PROMPT_UNTRACKED="$blue%%"
ZSH_THEME_GIT_PROMPT_MODIFIED="*" ZSH_THEME_GIT_PROMPT_MODIFIED="$red*"
ZSH_THEME_GIT_PROMPT_ADDED="+" ZSH_THEME_GIT_PROMPT_ADDED="$green+"
ZSH_THEME_GIT_PROMPT_STASHED="$" ZSH_THEME_GIT_PROMPT_STASHED="$blue$"
ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="=" ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="$green="
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">" ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<" ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<"
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="<>" ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="$red<>"
PROMPT='$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)' PROMPT='$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)'
PROMPT+='$(__git_ps1)' GIT_PROMPT='$(out=$(git_prompt_info)$(git_prompt_status)$(git_remote_status);if [[ -n $out ]]; then printf %s " $white($green$out$white)$reset";fi)'
PROMPT+="$GIT_PROMPT"
PROMPT+=" $last_command_output%#$reset " PROMPT+=" $last_command_output%#$reset "
RPROMPT='' RPROMPT=''
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
export VIRTUAL_ENV_DISABLE_PROMPT=1 export VIRTUAL_ENV_DISABLE_PROMPT=1
function virtualenv_info { function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('$fg[blue]`basename $VIRTUAL_ENV`%{$reset_color%}') ' [ $VIRTUAL_ENV ] && echo '('%F{blue}`basename $VIRTUAL_ENV`%f') '
} }
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
...@@ -20,18 +20,18 @@ autoload -U add-zsh-hook ...@@ -20,18 +20,18 @@ autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info
#use extended color pallete if available #use extended color pallete if available
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then if [[ $terminfo[colors] -ge 256 ]]; then
turquoise="%F{81}" turquoise="%F{81}"
orange="%F{166}" orange="%F{166}"
purple="%F{135}" purple="%F{135}"
hotpink="%F{161}" hotpink="%F{161}"
limegreen="%F{118}" limegreen="%F{118}"
else else
turquoise="$fg[cyan]" turquoise="%F{cyan}"
orange="$fg[yellow]" orange="%F{yellow}"
purple="$fg[magenta]" purple="%F{magenta}"
hotpink="$fg[red]" hotpink="%F{red}"
limegreen="$fg[green]" limegreen="%F{green}"
fi fi
# enable VCS systems you use # enable VCS systems you use
...@@ -48,7 +48,7 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true ...@@ -48,7 +48,7 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true
# %a - action (e.g. rebase-i) # %a - action (e.g. rebase-i)
# %R - repository path # %R - repository path
# %S - path in the repository # %S - path in the repository
PR_RST="%{${reset_color}%}" PR_RST="%f"
FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
FMT_ACTION="(%{$limegreen%}%a${PR_RST})" FMT_ACTION="(%{$limegreen%}%a${PR_RST})"
FMT_UNSTAGED="%{$orange%}●" FMT_UNSTAGED="%{$orange%}●"
...@@ -96,5 +96,5 @@ function steeef_precmd { ...@@ -96,5 +96,5 @@ function steeef_precmd {
add-zsh-hook precmd steeef_precmd add-zsh-hook precmd steeef_precmd
PROMPT=$' PROMPT=$'
%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_$(virtualenv_info)%{$reset_color%} %{$purple%}%n${PR_RST} at %{$orange%}%m${PR_RST} in %{$limegreen%}%~${PR_RST} $vcs_info_msg_0_$(virtualenv_info)
$ ' $ '
set -e set -e
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
ncolors=$(tput colors)
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
exit
fi
unset CHECK_ZSH_INSTALLED
if [ ! -n "$ZSH" ]; then if [ ! -n "$ZSH" ]; then
ZSH=~/.oh-my-zsh ZSH=~/.oh-my-zsh
fi fi
if [ -d "$ZSH" ]; then if [ -d "$ZSH" ]; then
echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install" printf "${YELLOW}You already have Oh My Zsh installed.${NORMAL}\n"
printf "You'll need to remove $ZSH if you want to re-install.\n"
exit exit
fi fi
echo "\033[0;34mCloning Oh My Zsh...\033[0m" # Prevent the cloned repository from having insecure permissions. Failing to do
# so causes compinit() calls to fail with "command not found: compdef" errors
# for users with insecure umasks (e.g., "002", allowing group writability). Note
# that this will be ignored under Cygwin by default, as Windows ACLs take
# precedence over umasks except for filesystems mounted with option "noacl".
umask g-w,o-w
printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
hash git >/dev/null 2>&1 || { hash git >/dev/null 2>&1 || {
echo "Error: git is not installed" echo "Error: git is not installed"
exit 1 exit 1
} }
env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
printf "Error: git clone of oh-my-zsh repo failed\n"
exit 1
}
# The Windows (MSYS) Git is not compatible with normal use on cygwin # The Windows (MSYS) Git is not compatible with normal use on cygwin
if [ "$OSTYPE" = cygwin ]; then if [ "$OSTYPE" = cygwin ]; then
if git --version | grep msysgit > /dev/null; then if git --version | grep msysgit > /dev/null; then
...@@ -22,48 +60,54 @@ if [ "$OSTYPE" = cygwin ]; then ...@@ -22,48 +60,54 @@ if [ "$OSTYPE" = cygwin ]; then
exit 1 exit 1
fi fi
fi fi
env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
echo "Error: git clone of oh-my-zsh repo failed"
exit 1
}
echo "\033[0;34mLooking for an existing zsh config...\033[0m" printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n"
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m"; printf "${YELLOW}Found ~/.zshrc.${NORMAL} ${GREEN}Backing up to ~/.zshrc.pre-oh-my-zsh${NORMAL}\n";
mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh; mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
fi fi
echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
cp $ZSH/templates/zshrc.zsh-template ~/.zshrc cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
sed -i -e "/^export ZSH=/ c\\ sed "/^export ZSH=/ c\\
export ZSH=$ZSH export ZSH=$ZSH
" ~/.zshrc " ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" printf "${BLUE}Copying your current PATH and adding it to the end of ~/.zshrc for you.${NORMAL}\n"
sed -i -e "/export PATH=/ c\\ sed "/export PATH=/ c\\
export PATH=\"$PATH\" export PATH=\"$PATH\"
" ~/.zshrc " ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
# If this user's login shell is not already "zsh", attempt to switch.
TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
# If this platform provides a "chsh" command (not Cygwin), do it, man!
if hash chsh >/dev/null 2>&1; then if hash chsh >/dev/null 2>&1; then
echo "\033[0;34mTime to change your default shell to zsh!\033[0m" printf "${BLUE}Time to change your default shell to zsh!${NORMAL}\n"
chsh -s $(grep /zsh$ /etc/shells | tail -1) chsh -s $(grep /zsh$ /etc/shells | tail -1)
# Else, suggest the user do so manually.
else else
echo "I can't change your shell automatically because this system does not have chsh." printf "I can't change your shell automatically because this system does not have chsh.\n"
echo "Please edit /etc/passwd to set your default shell to zsh." printf "${BLUE}Please manually change your default shell to zsh!${NORMAL}\n"
fi fi
fi fi
unset TEST_CURRENT_SHELL
echo "\033[0;32m"' __ __ '"\033[0m" printf "${GREEN}"
echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" echo ' __ __ '
echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" echo ' /____/ ....is now installed!'
echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" echo ''
echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" echo ''
echo 'Please look over the ~/.zshrc file to select plugins, themes, and options.'
echo ''
echo 'p.s. Follow us at https://twitter.com/ohmyzsh.'
echo ''
echo 'p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.'
echo ''
printf "${NORMAL}"
env zsh env zsh
. ~/.zshrc
printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh"
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
ncolors=$(tput colors)
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
printf "${BLUE}%s${NORMAL}\n" "Upgrading Oh My Zsh"
cd "$ZSH" cd "$ZSH"
if git pull --rebase --stat origin master if git pull --rebase --stat origin master
then then
printf '\033[0;32m%s\033[0m\n' ' __ __ ' printf '%s' "$GREEN"
printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' printf '%s\n' ' __ __ '
printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' printf '%s\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' printf '%s\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' printf '%s\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
printf '\033[0;32m%s\033[0m\n' ' /____/ ' printf '%s\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' printf '%s\n' ' /____/ '
printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest news and updates, follow us on twitter: ' 'http://twitter.com/ohmyzsh' printf "${BLUE}%s\n" "Hooray! Oh My Zsh has been updated and/or is at the current version."
printf '\033[0;34m%s\033[1m%s\033[0m\n' 'Get your Oh My Zsh swag at: ' 'http://shop.planetargon.com/' printf "${BLUE}${BOLD}%s${NORMAL}\n" "To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh"
printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: http://shop.planetargon.com/"
else else
printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' printf "${RED}%s${NORMAL}\n" 'There was an error updating. Try again later?'
fi fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment