summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Janke <janke@pobox.com>2015-02-28 01:46:10 -0500
committerMarc Cornellà <marc.cornella@live.com>2019-06-03 17:18:24 +0200
commitaa27430e10b10aa1ff879722095696c66bed85ae (patch)
treee00b34ed9608cddbb3db93a3bd4217489458db49 /tools
parenta6a093ba2aed292f0610110c0e787aca57288319 (diff)
downloadzsh-aa27430e10b10aa1ff879722095696c66bed85ae.tar.gz
zsh-aa27430e10b10aa1ff879722095696c66bed85ae.tar.bz2
zsh-aa27430e10b10aa1ff879722095696c66bed85ae.zip
installer: add ability to install from forked & branched repos
This facilitates testing of changes to the core installation code: you'll be able to do a roundtrip test of install and uninstall using the working code on your branch. Controlled by passing $REPO and $BRANCH environment variables to install.sh.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/install.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/install.sh b/tools/install.sh
index f91e02954..0d5ad2633 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -5,13 +5,21 @@
# or wget:
# sh -c "$(wget -qO- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
#
-# As an alternative, you can download the install script separately and
-# run it afterwards with `sh install.sh'
+# As an alternative, you can first download the install script and run it afterwards:
+# wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
+# sh install.sh
+#
+# Respects these environment variables for tweaking the installation process:
+# REPO - name of the GitHub repo to install from (default: robbyrussell/oh-my-zsh)
+# BRANCH - branch to check out immediately after install
#
set -e
-# Default location
+# Default settings
ZSH=${ZSH:-~/.oh-my-zsh}
+REPO=${REPO:-robbyrussell/oh-my-zsh}
+BRANCH=${BRANCH:-master}
+
command_exists() {
command -v "$@" >/dev/null 2>&1
@@ -68,7 +76,7 @@ setup_ohmyzsh() {
exit 1
fi
- git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git "$ZSH" || {
+ git clone --depth=1 --branch "$BRANCH" "https://github.com/$REPO.git" "$ZSH" || {
error "git clone of oh-my-zsh repo failed"
exit 1
}