Commit aa27430e authored by Andrew Janke's avatar Andrew Janke Committed by Marc Cornellà
Browse files

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.
parent a6a093ba
...@@ -5,13 +5,21 @@ ...@@ -5,13 +5,21 @@
# or wget: # or wget:
# sh -c "$(wget -qO- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" # 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 # As an alternative, you can first download the install script and run it afterwards:
# run it afterwards with `sh install.sh' # 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 set -e
# Default location # Default settings
ZSH=${ZSH:-~/.oh-my-zsh} ZSH=${ZSH:-~/.oh-my-zsh}
REPO=${REPO:-robbyrussell/oh-my-zsh}
BRANCH=${BRANCH:-master}
command_exists() { command_exists() {
command -v "$@" >/dev/null 2>&1 command -v "$@" >/dev/null 2>&1
...@@ -68,7 +76,7 @@ setup_ohmyzsh() { ...@@ -68,7 +76,7 @@ setup_ohmyzsh() {
exit 1 exit 1
fi 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" error "git clone of oh-my-zsh repo failed"
exit 1 exit 1
} }
......
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