-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·105 lines (82 loc) · 2.84 KB
/
install.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#! /bin/bash
# from dpeticol's dotfiles, with mods
ignore=( install.sh uninstall.sh .git .gitmodules README.mdown backups macOS\ copy.xml )
DIR=~/dotfiles
OS=$(uname -s)
cd $DIR/base16
git submodule init
git submodule update
cd $DIR
if [ ! -e ${DIR}/backups ]; then
mkdir backups
fi
# Install dependencies
if [ "$OS" = "Linux" ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
sudo apt-get install build-essential cmake python-dev libclang-dev markdown smartypants multimarkdown || (sudo pacman -Syu wget gvim base-devel cmake python2 python2-pip clang python-markdown fakeroot jshon expac bash-completion && wget https://aur.archlinux.org/packages/pa/packer/PKGBUILD && makepkg && sudo pacman -U packer-*.pkg.tar.xz && sudo packer -S python2-smartypants multimarkdown && pip2 install rauth) || brew -v bundle
rm -rf PKGBUILD* packer-*.pkg.tar.xz packer/ pkg/ src/
fi
if [ "$OS" = "Darwin" ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew -v bundle
sudo bash -c "echo `which bash` >> /etc/shells"
chsh -s `which bash`
fi
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
sudo `which pip3` install neovim
git clone https://github.com/ryuone/nenv.git ~/.nenv
git clone https://github.com/mattreduce/oblique-fortunes.git
cd oblique-fortunes
cp oblique* /opt/homebrew/Cellar/fortune/**/share/games/fortunes/
rm -rf $DIR/oblique-fortunes
touch agignore bashrc_p
for filename in *
do
# check if the file should be ignored
shouldIgnore=false
for ignorename in ${ignore[@]}
do
if [[ $filename == $ignorename ]]
then
shouldIgnore=true
fi
done
# if you shouldn't ignore, and it's not already linked
if [ $shouldIgnore == false -a ! -L ~/.$filename ]
then
# move old versions moved to backup dir
if [ -e ~/.$filename ]
then
echo ${filename} moved to ${DIR}/backups/${filename}
mv ~/.$filename $DIR/backups/
fi
# create the link
echo new link ~/.${filename} to ${DIR}/backups/${filename}
ln -s $DIR/$filename ~/.$filename
fi
done
mkdir -p ~/.config
ln -s ~/.vim ~/.config/nvim
if [ -e ~/.bash_profile ]; then
mv ~/.bash_profile $DIR/backups/
fi
ln -s ~/.bashrc ~/.bash_profile
# Install Vundle and packages
if [ ! -e ${DIR}/vim/bundle/vundle ]; then
git clone https://github.com/gmarik/vundle ${DIR}/vim/bundle/vundle
vim +BundleInstall +qa
vim +UpdateRemotePlugins +qa
fi
# Compile ctrlp-cmatcher
if [ ! -e ${DIR}/vim/bundle/ctrlp-cmatcher/autoload/build/lib* ]; then
cd ${DIR}/vim/bundle/ctrlp-cmatcher
if [ "$OS" = "Darwin" ]; then
CFLAGS=-Qunused-arguments
CPPFLAGS=-Qunused-arguments
fi
./install.sh
fi
# install fzf
$(brew --prefix)/opt/fzf/install
# install fzf-tab-completion
git clone https://github.com/lincheney/fzf-tab-completion ~/.fzf-tab-completion