Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer: fix, refactor and add installer arguments #5169

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9a832cc
installer: use exit-on-error from the beginning
mcornella May 29, 2016
73ef051
installer: use tabs to allow future heredocs
mcornella Aug 9, 2016
f944439
installer: reorganise and add comments
mcornella May 30, 2016
a7bd1f9
installer: extract most code into functions
mcornella May 29, 2016
576499a
installer: fix for failed chsh quitting the installation
mcornella May 21, 2019
1fdd535
installer: abstract error messages
mcornella May 21, 2019
73f2908
installer: replace the current shell with the new ZSH instance
Luca0208 Jul 19, 2018
8e10ac4
installer: make sure shell in /etc/shells is not commented
Oct 8, 2018
62216aa
installer: use guard clauses in setup_shell for better readability
mcornella May 24, 2019
9d2b3ce
installer: fix for Solus OS and systems with no /etc/shells
frbuceta May 24, 2019
a6a093b
installer: improve zsh binary path search in setup_shell
mcornella May 24, 2019
aa27430
installer: add ability to install from forked & branched repos
apjanke Feb 28, 2015
220d69b
installer: allow configuration of remote URL to clone from
mcornella May 26, 2019
153f5e1
installer: use default color sequences on missing tput
mcornella May 24, 2019
43b3126
installer: use timestamped backups to preserve all old zshrcs
apjanke Sep 23, 2015
794ff4a
installer: add ability to skip the default shell change
mcornella May 27, 2019
a40d932
installer: don't run zsh at the end
mcornella May 27, 2019
1cf42a5
installer: add option to not run zsh at the end
mcornella May 27, 2019
065844f
installer: comment changes
mcornella May 27, 2019
b931d6a
installer: change to --unattended argument and add docs
mcornella May 28, 2019
66d6d08
installer: improve message formatting and color
mcornella May 28, 2019
2e54ba2
installer: restore previous default shell with uninstall
Oct 13, 2017
0824dcc
installer: allow for tput errors
mcornella Jun 1, 2019
b944fee
installer: ask user about changing the shell to zsh
mcornella Jun 1, 2019
c8ac403
installer: add documentation of new installer features to README
mcornella Jun 3, 2019
52fdae4
Merge pull request #5169 from mcornella/refactor-installer
mcornella Jun 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

[*.sh]
indent_size = 4
indent_style = tab
69 changes: 61 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/mas
#### via wget

```shell
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```

#### Manual inspection

It's a good idea to inspect the install script from projects you don't yet know. You can do
that by downloading the install script first, looking through it so everything looks normal,
then running it:

```shell
curl -Lo install.sh https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
sh install.sh
```

## Using Oh My Zsh
Expand Down Expand Up @@ -69,6 +80,8 @@ plugins=(
)
```

_Note that the plugins are separated by whitespace. **Do not** use commas between them._

#### Using Plugins

Most plugins (should! we're working on this) include a __README__, which documents how to use them.
Expand Down Expand Up @@ -124,16 +137,53 @@ If you're the type that likes to get their hands dirty, these sections might res

### Advanced Installation

Some users may want to change the default path, or manually install Oh My Zsh.
Some users may want to manually install Oh My Zsh, or change the default path or other settings that
the installer accepts (these settings are also documented at the top of the install script).

#### Custom Directory

The default location is `~/.oh-my-zsh` (hidden in your home directory)

If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
If you'd like to change the install directory with the `ZSH` environment variable, either by running
`export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline
like this:

```shell
ZSH="$HOME/.dotfiles/oh-my-zsh" sh install.sh
```

#### Unattended install

If you're running the Oh My Zsh install script as part of an automated install, you can pass the
flag `--unattended` to the `install.sh` script. This will have the effect of not trying to change
the default shell, and also won't run `zsh` when the installation has finished.

```shell
export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
curl -Lo install.sh https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
sh install.sh --unattended
```

#### Installing from a forked repository

The install script also accepts these variables to allow installation of a different repository:

- `REPO` (default: `robbyrussell/oh-my-zsh`): this takes the form of `owner/repository`. If you set
this variable, the installer will look for a repository at `https://github.com/{owner}/{repository}`.

- `REMOTE` (default: `https://github.com/${REPO}.git`): this is the full URL of the git repository
clone. You can use this setting if you want to install from a fork that is not on GitHub (GitLab,
Bitbucket...) or if you want to clone with SSH instead of HTTPS (`git@github.com:user/project.git`).

_NOTE: it's incompatible with setting the `REPO` variable. This setting will take precedence._

- `BRANCH` (default: `master`): you can use this setting if you want to change the default branch to be
checked out when cloning the repository. This might be useful for testing a Pull Request, or if you
want to use a branch other than `master`.

For example:

```shell
REPO=apjanke/oh-my-zsh BRANCH=edge sh install.sh
```

#### Manual Installation
Expand Down Expand Up @@ -161,9 +211,10 @@ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
##### 4. Change your default shell

```shell
chsh -s /bin/zsh
chsh -s $(which zsh)
```
You must log out and log back in to see this change.

You must log out from your user session and log back in to see this change.

##### 5. Initialize your new zsh configuration

Expand All @@ -173,8 +224,10 @@ Once you open up a new terminal window, it should load zsh with Oh My Zsh's conf

If you have any hiccups installing, here are a few common fixes.

* You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`.
* If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`.
* You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after
switching to `oh-my-zsh`.
* If you installed manually or changed the install location, check the `ZSH` environment variable in
`~/.zshrc`.

### Custom Plugins and Themes

Expand Down
Loading