Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow (re)installing from a local copy #1086

Closed
wants to merge 2 commits into from

2 participants

@avit

I've decoupled the downloading from the other install & linking steps, so an existing checkout of oh-my-zsh doesn't stop the installer and can be used for re-installing.

This feature depends on my other pull request to allow setting the install location. (It also means that by changing $ZSH, you can re-run the install script from different copies.)

@avit

I've rebased this to your master again, let me know if you still want to merge it.

avit added some commits
@avit avit Accept alternate install paths via ZSH variable
Uses environment variable $ZSH to configure install location.
27d1f41
@avit avit Allow (re)installing from local repo
If a local directory exists, perhaps a forked copy instead of the robbyrussell master,
this allows the installer script to use it and continue the install process instead
of exiting early.

Changes the installer to continue even if the $ZSH directory is already installed.
77f0110
@avit

@robbyrussell I've just rebased this too, please comment, merge, or close.

@avit

@robbyrussell Reason for closing? This one is a good follow-up for #1085.

Rebased again with the changes from 1085.

@avit

This would still be handy for testing... let me know if you want me to rebase it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2013
  1. @avit

    Accept alternate install paths via ZSH variable

    avit authored
    Uses environment variable $ZSH to configure install location.
  2. @avit

    Allow (re)installing from local repo

    avit authored
    If a local directory exists, perhaps a forked copy instead of the robbyrussell master,
    this allows the installer script to use it and continue the install process instead
    of exiting early.
    
    Changes the installer to continue even if the $ZSH directory is already installed.
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 10 deletions.
  1. +7 −1 README.textile
  2. +16 −9 tools/install.sh
View
8 README.textile
@@ -20,9 +20,15 @@ h4. via `wget`
@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
-h3. The manual way
+h4. Install location
+
+You can change the install destination via the ZSH environment variable. The default location is `~/.oh-my-zsh`:
+
+@...install.sh | ZSH=~/.dotfiles sh@
+h3. The manual way
+
1. Clone the repository
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
View
25 tools/install.sh
@@ -1,14 +1,18 @@
-if [ -d ~/.oh-my-zsh ]
+set -e
+
+if [ ! -n $ZSH ]
then
- echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install"
- exit
+ ZSH=~/.oh-my-zsh
fi
-echo "\033[0;34mCloning Oh My Zsh...\033[0m"
-hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || {
- echo "git not installed"
- exit
-}
+if [ ! -d $ZSH ]
+then
+ echo "\033[0;34mCloning Oh My Zsh...\033[0m"
+ hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
+ echo "git not installed"
+ exit
+ }
+fi
echo "\033[0;34mLooking for an existing zsh config...\033[0m"
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
@@ -18,7 +22,10 @@ then
fi
echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
-cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
+cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
+sed -i -e "/^ZSH=/ c\\
+ZSH=$ZSH
+" ~/.zshrc
echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
echo "export PATH=\$PATH:$PATH" >> ~/.zshrc
Something went wrong with that request. Please try again.