PageRenderTime 24ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/install.bash

https://github.com/jherdman/dotfiles
BASH | 68 lines | 49 code | 11 blank | 8 comment | 12 complexity | e83d4ac65464a43eaf085aa4e5a0b922 MD5 | raw file
  1. #!/usr/bin/env bash
  2. ##
  3. # Based on https://github.com/michaeljsmalley/dotfiles/blob/892e310cb4ef0e334ab838c27d644d40d690b678/makesymlinks.sh
  4. ##
  5. # This directory, no matter what
  6. DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
  7. THIS=${0##*/} # http://stackoverflow.com/questions/192319/how-do-i-know-the-script-file-name-in-a-bash-script
  8. for file in $DIR/*
  9. do
  10. if [[ -f $file ]] && [[ $file != *"${THIS}" ]]; then
  11. bn=`basename $file`
  12. ln -sfv $file "${HOME}/.${bn}"
  13. elif [[ -d $file ]] && [[ $file != *"${THIS}" ]]; then
  14. bn=`basename $file`
  15. ln -sfv $file "${HOME}/.${bn}"
  16. fi
  17. done
  18. #curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
  19. UNAMESTR=`uname`
  20. if [[ $UNAMESTR == 'Darwin' ]]; then
  21. echo "Installing packages for OS X..."
  22. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  23. brew install neovim/neovim/neovim
  24. brew install tmux tmux-pasteboard reattach-to-user-namespace ripgrep
  25. elif [[ $UNAMESTR == 'Linux' ]]; then
  26. echo "Installing packages for Linux..."
  27. sudo apt-get install software-properties-common
  28. sudo add-apt-repository ppa:neovim-ppa/unstable
  29. sudo add-apt-repository -y ppa:pi-rho/dev
  30. sudo apt-get update
  31. sudo apt-get install neovim
  32. # https://gist.github.com/P7h/91e14096374075f5316e
  33. TMUX_VERSION=2.6
  34. sudo apt-get -y remove tmux
  35. sudo apt-get -y install wget tar libevent-dev libncurses-dev
  36. wget https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
  37. tar xf tmux-${TMUX_VERSION}.tar.gz
  38. rm -f tmux-${TMUX_VERSION}.tar.gz
  39. cd tmux-${TMUX_VERSION}
  40. ./configure
  41. make
  42. sudo make install
  43. cd -
  44. sudo rm -rf /usr/local/src/tmux-*
  45. sudo mv tmux-${TMUX_VERSION} /usr/local/sr
  46. # Install ripgrep
  47. RIPGREP_VERSION="0.7.1"
  48. RIPGREP_FILE_NAME="ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl"
  49. cd $HOME
  50. curl -LO https://github.com/BurntSushi/ripgrep/releases/download/${RIPGREP_VERSION}/${RIPGREP_FILE_NAME}.tar.gz
  51. tar xvzf ${RIPGREP_FILE_NAME}.tar.gz
  52. sudo mv ${RIPGREP_FILE_NAME}/rg /usr/local/bin/
  53. else
  54. echo "Unknown platform ${UNAMESTR}! Packages not installed."
  55. fi
  56. curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  57. git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell