-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·82 lines (66 loc) · 1.99 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
set -e
# Install xcode command line tools
echo "Looking for existing xcode installation..."
xcode-select -p > /dev/null
if [[ $? != 0 ]] ; then
echo "Xcode command line tools not found. Installing..."
xcode-select --install
fi
# Install homebrew if its not already installed
echo "Looking for existing brew installation..."
which -s brew > /dev/null
if [[ $? != 0 ]] ; then
echo "Brew not found. Installing..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Brew installation found. Updating..."
brew update
fi
# Create my standard directories if they don't exist
echo "Creating standard directories"
mkdir -p ~/Projects
mkdir -p ~/Scripts
cd ~/Projects
# Clone the dotfiles repo if not already there
echo "Cloning repo"
[ ! -d "./dotfiles" ] && git clone https://github.com/JCPistell/dotfiles.git || echo "repo already exists"
DIR=$(pwd)/dotfiles
# Install brew packages
echo "Installing brew objects"
brew bundle --file=$DIR/Brewfile
# Set up symlinks
echo "Symlinking dotfiles"
mkdir -p ~/.config/nvim
ln -nfs $DIR/bash_profile ~/.bash_profile
ln -nfs $DIR/bashrc ~/.bashrc
ln -nfs $DIR/tmux.conf ~/.tmux.conf
ln -nfs $DIR/vimrc ~/.vimrc
ln -nfs $DIR/gitignore_global ~/.gitignore_global
ln -nfs $DIR/spacemacs ~/.spacemacs
ln -nfs $DIR/flake8 ~/.config/flake8
ln -nfs $DIR/init.vim ~/.config/nvim/init.vim
# Set up virtualenvs
echo "Setting up Python virtualenvs"
PY3VERSION=3.7.5
echo "Python3 version: $PY3VERSION"
pyenv install $PY3VERSION
pyenv install 2.7.14
pyenv global $PY3VERSION
pyenv virtualenv 2.7.14 neovim2
pyenv virtualenv $PY3VERSION neovim3
sleep 3
pyenv activate neovim2
pip install neovim
pyenv deactivate
sleep 3
pyenv activate neovim3
pip install neovim
pip install flake8
pip install jedi
pyenv deactivate
# Set up vim
echo "Setting up vim"
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugInstall +qall