Skip to content

Commit

Permalink
#501: Deprecate installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
nvbn committed May 9, 2016
1 parent 9e39bcd commit 15bcd7f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 92 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ Reading package lists... Done

## Installation

On Ubuntu you can install `The Fuck` with installation script [*experimental*]:

```bash
wget -O - https://raw.githubusercontent.com/nvbn/thefuck/master/install.sh | sh - && $0
```

On OS X you can install `The Fuck` with [Homebrew][homebrew]:

```bash
brew install thefuck
```

## Manual installation
On Ubuntu you can install `The Fuck` with:

```bash
sudo apt update
sudo apt install python3-dev python3-pip
sudo -H pip3 install thefuck
```

Install `The Fuck` with `pip`:
On other systems you can install `The Fuck` with `pip`:

```bash
sudo -H pip install thefuck
Expand Down
61 changes: 2 additions & 59 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,61 +1,4 @@
#!/bin/sh

should_add_alias () {
[ -f $1 ] && ! grep -q thefuck $1
}

installed () {
hash $1 2>/dev/null
}

install_thefuck () {
# Install OS dependencies:
if installed apt-get; then
# Debian/Ubuntu:
sudo apt-get update -yy
sudo apt-get install -yy python-pip python-dev command-not-found python-gdbm

if [ -n "$(apt-cache search python-commandnotfound)" ]; then
# In case of different python versions:
sudo apt-get install -yy python-commandnotfound
fi
else
if installed brew; then
# OS X:
brew update
brew install python
else
# Generic way:
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
rm get-pip.py
fi
fi

# thefuck requires fresh versions of setuptools and pip:
sudo pip install -U pip setuptools
sudo pip install -U thefuck

# Setup aliases:
if should_add_alias ~/.bashrc; then
echo 'eval $(thefuck --alias)' >> ~/.bashrc
fi

if should_add_alias ~/.bash_profile; then
echo 'eval $(thefuck --alias)' >> ~/.bash_profile
fi

if should_add_alias ~/.zshrc; then
echo 'eval $(thefuck --alias)' >> ~/.zshrc
fi

if should_add_alias ~/.config/fish/config.fish; then
thefuck --alias >> ~/.config/fish/config.fish
fi

if should_add_alias ~/.tcshrc; then
echo 'eval `thefuck --alias`' >> ~/.tcshrc
fi
}

install_thefuck
echo "Installation script is deprecated!"
echo "For installation instruction please visit https://github.com/nvbn/thefuck"
25 changes: 0 additions & 25 deletions tests/functional/test_install.py

This file was deleted.

0 comments on commit 15bcd7f

Please sign in to comment.