Update install.sh

This commit is contained in:
Smirnov-O 2020-05-22 21:09:29 +03:00
parent 2a0cf55420
commit d6d447ed32

View file

@ -1,56 +1,48 @@
#/bin/bash #/bin/bash
read -p "Enter home paht(exemple: \"/home/user\"): " HOME_PAHT read -p "\e[31m All your git, vim, bash, tmux, zsh settings will be deleted [y/n]" CONTINUE
read -p "Remove old config [y/n]: " REMOVE_CONF if [[ "$CONTINUE" == "y" ]]; then
read -p "Install vim config [y/n]: " VIM_CONF rm -rf ~/.vimrc ~/.vim
read -p "Install git config [y/n]: " GIT_CONF rm -rf ~/.gitconfig ~/.git*
read -p "Install bash config [y/n]: " BASH_CONF rm -rf ~/.bashrc ~/.bash*
read -p "Intall tmux config [y/n]: " TMUX_CONF rm -rf ~/.tmux ~/.tmux*
read -p "Install zsh config [y/n]: " ZSH_CONF rm -rf ~/.zshrc ~/.oh-my-zsh
if [[ "$REMOVE_CONF" = "y" ]]; then
rm -rf $HOME_PAHT/.vimrc $HOME_PAHT/.vim
rm -rf $HOME_PAHT/.gitconfig $HOME_PAHT/.gitignore_global
rm -rf $HOME_PAHT/.bashrc
rm -rf $HOME_PAHT/.tmux .tmux.conf
rm -rf $HOME_PAHT/.zshrc $HOME_PAHT/.oh-my-zsh
elif [[ "$VIM_CONF" = "y" ]]; then read -p "Install vim config [y/n]: " VIM_CONF
sudo apt-get install vim curl git -y read -p "Install git config [y/n]: " GIT_CONF
read -p "Install bash config [y/n]: " BASH_CONF
read -p "Intall tmux config [y/n]: " TMUX_CONF
read -p "Install zsh config [y/n]: " ZSH_CONF
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim cd ~/.dotfiles
ln vimrc $HOME_PAHT/.vimrc if [[ "$VIM_CONF" = "y" ]]; then
vim +source$HOME_PAHT/.vimrc +PlugInstall sudo apt-get install vim vim-gui-common curl -y
curl -fLo ~.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
elif [[ "$GIT_CONF" = "y" ]]; then ln vimrc ~/.vimrc
ln gitconfig $HOME_PAHT/.gitconfig #vim +source~/.vimrc +PlugInstall
ln gitignore_global $HOME_PAHT/.gitignore_global elif [[ "$GIT_CONF" = "y" ]]; then
ln gitconfig ~/.gitconfig
elif [[ "$BASH_CONF" = "y" ]]; then ln gitignore_global ~/.gitignore_global
sudo apt-get install bash -y elif [[ "$BASH_CONF" = "y" ]]; then
ln bashrc $HOME_PAHT/.bashrc sudo apt-get install bash -y
ln bashrc ~/.bashrc
elif [[ "$TMUX_CONF" = "y" ]]; then elif [[ "$TMUX_CONF" = "y" ]]; then
sudo apt-get install tmux git -y sudo apt-get install tmux -y
git clone https://github.com/gpakosz/.tmux.git $HOME_PAHT/.tmux git clone https://github.com/gpakosz/.tmux.git ~/.tmux
mv $HOME_PAHT/.tmux/.tmux.conf $HOME_PAHT/.tmux.conf mv ~/.tmux/.tmux.conf ~/.tmux.conf
mv $HOME_PAHT/.tmux/.tmux.conf.local $HOME_PAHT/.tmux.conf.local mv ~/.tmux/.tmux.conf.local ~/.tmux.conf.local
# rm -rf $HOME_PAHT/.tmux elif [[ "$ZSH_CONF" = "y" ]]; then
sudo apt-get install zsh curl -y
elif [[ "$ZSH_CONF" = "y" ]]; then sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo apt-get install zsh curl git echo "alias cls='clear'" >> ~/.zshrc
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" echo "alias sl='ls'" >> ~/.zshrc
echo "alias cd..='cd ..'" >> ~/.zshrc
echo "alias cls='clear'" >> $HOME_PAHT/.zshrc echo "alias py='python3'" >> ~/.zshrc
echo "alias sl='ls'" >> $HOME_PAHT/.zshrc echo "alias py3='python3'" >> ~/.zshrc
echo "alias cd..='cd ..'" >> $HOME_PAHT/.zshrc echo "alias ipy='ipython3'" >> ~/.zshrc
echo "alias py='python3'" >> $HOME_PAHT/.zshrc echo "alias ipy3='ipython3'" >> ~/.zshrc
echo "alias py3='python3'" >> $HOME_PAHT/.zshrc sed -i "s/plugins=(git)/plugins=(autopep8 djando pip git tmux docker)"
echo "alias ipy='ipython3'" >> $HOME_PAHT/.zshrc sed -i "s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"simple\"" ~/.zshrc
echo "alias ipy3='ipython3'" >> $HOME_PAHT/.zshrc else
echo ""
sed -i "s/plugins=(git)/plugins=(autopep8 djando pip systemd debian git tmux docker ansible)" fi
sed -i "s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"simple\"" $HOME_PAHT/.zshrc fi
else
echo "OK"
fi