mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-30 22:54:14 +00:00 
			
		
		
		
	#501: Deprecate installation script
This commit is contained in:
		
							
								
								
									
										16
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README.md
									
									
									
									
									
								
							| @@ -96,21 +96,21 @@ Reading package lists... Done | |||||||
|  |  | ||||||
| ## Installation | ## 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]: | On OS X you can install `The Fuck` with [Homebrew][homebrew]: | ||||||
|  |  | ||||||
| ```bash | ```bash | ||||||
| brew install thefuck | brew install thefuck | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ## Manual installation | On Ubuntu you can install `The Fuck` with: | ||||||
|   |   | ||||||
| Install `The Fuck` with `pip`: | ```bash | ||||||
|  | sudo apt update | ||||||
|  | sudo apt install python3-dev python3-pip | ||||||
|  | sudo -H pip3 install thefuck | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | On other systems you can install `The Fuck` with `pip`: | ||||||
|  |  | ||||||
| ```bash | ```bash | ||||||
| sudo -H pip install thefuck | sudo -H pip install thefuck | ||||||
|   | |||||||
							
								
								
									
										61
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										61
									
								
								install.sh
									
									
									
									
									
								
							| @@ -1,61 +1,4 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  |  | ||||||
| should_add_alias () { | echo "Installation script is deprecated!" | ||||||
|     [ -f $1 ] && ! grep -q thefuck $1 | echo "For installation instruction please visit https://github.com/nvbn/thefuck" | ||||||
| } |  | ||||||
|  |  | ||||||
| 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 |  | ||||||
|   | |||||||
| @@ -1,25 +0,0 @@ | |||||||
| import pytest |  | ||||||
| from thefuck.utils import get_installation_info |  | ||||||
|  |  | ||||||
| envs = ((u'bash', 'thefuck/ubuntu-bash', u''' |  | ||||||
| FROM ubuntu:latest |  | ||||||
| RUN apt-get update |  | ||||||
| RUN apt-get install -yy bash |  | ||||||
| '''), (u'bash', 'thefuck/generic-bash', u''' |  | ||||||
| FROM fedora:latest |  | ||||||
| RUN dnf install -yy python-devel sudo wget gcc |  | ||||||
| ''')) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @pytest.mark.functional |  | ||||||
| @pytest.mark.skip_without_docker |  | ||||||
| @pytest.mark.parametrize('shell, tag, dockerfile', envs) |  | ||||||
| def test_installation(spawnu, shell, TIMEOUT, tag, dockerfile): |  | ||||||
|     proc = spawnu(tag, dockerfile, shell) |  | ||||||
|     proc.sendline(u'cat /src/install.sh | sh - && $0') |  | ||||||
|     proc.sendline(u'thefuck --version') |  | ||||||
|     version = get_installation_info().version |  | ||||||
|     assert proc.expect([TIMEOUT, u'thefuck {}'.format(version)], |  | ||||||
|                        timeout=600) |  | ||||||
|     proc.sendline(u'fuck') |  | ||||||
|     assert proc.expect([TIMEOUT, u'No fucks given']) |  | ||||||
		Reference in New Issue
	
	Block a user