From 5808761dc868e3cf22386e03a472240be71b9c56 Mon Sep 17 00:00:00 2001 From: ys Date: Wed, 24 Apr 2013 12:52:09 +0800 Subject: [PATCH] add: Update the support of git submodules. Including install instrument, installation tool and upgrade tool. --- README.textile | 4 ++-- tools/install.sh | 6 ++++++ tools/upgrade.sh | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.textile b/README.textile index 0a4545bac..5b646f1fc 100644 --- a/README.textile +++ b/README.textile @@ -22,9 +22,9 @@ h4. via `wget` h3. The manual way -1. Clone the repository +1. Clone the repository and all submodules. - @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ + @git clone --recursive git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ 2. *OPTIONAL* Backup your existing ~/.zshrc file diff --git a/tools/install.sh b/tools/install.sh index a2bd5665a..abd49181a 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -10,6 +10,12 @@ hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh exit } +echo "\033[0;34mCloining submodule...\033[0m" +current_path=`pwd` +cd ~/.oh-my-zsh +/usr/bin/env git submodule update --init +cd "$current_path" + echo "\033[0;34mLooking for an existing zsh config...\033[0m" if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] then diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 0aeebdebf..6ef22a5f5 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -3,7 +3,7 @@ current_path=${current_path/ /\\ } printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh" cd "$ZSH" -if git pull origin master +if git pull origin master && git submodule foreach git pull then printf '\033[0;32m%s\033[0m\n' ' __ __ ' printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '