-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·65 lines (51 loc) · 1.62 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
#!/bin/bash
echo "Welcome to Anass dotFiles Initialization"
DEBENDENCIES="git vim zsh gcc-cc++ cmake ctags"
DEB_DEBENDENCIES="python-dev"
RED_DEBENDENCIES="python-devel"
echo "Installing Debendencies..."
if [ -f /etc/lsb-release ]; then
OS=`lsb_release -si`
if [ "$OS" == "Arch" ]; then
yes | sudo pacman -S $DEBENDENCIES
elif [ "$OS" == "Fedora" ]; then
sudo yum install -y $DEBENDENCIES $RED_DEBENDENCIES
elif [ "$OS" == "Ubuntu" ]; then
sudo apt-get install -y $DEBENDENCIES $DEB_DEBENDENCIES
fi
elif [ -f /etc/debian_version ]; then
sudo apt-get install -y $DEBENDENCIES $DEB_DEBENDENCIES
elif [ -f /etc/redhat-release ]; then
sudo yum install -y $DEBENDENCIES $RED_DEBENDENCIES
else
echo "Failed to detect your distro."
echo "Please Install these dependencies: $DEBENDENCIES $DEB_DEBENDENCIES"
exit
fi
# Git Repo of our Dot Files
GIT_REPO="https://github.com/anassahmed/dotfiles.git"
# Home Git command to download to the home directory
HOMEGIT="git --work-tree=$HOME --git-dir=$HOME/.dotfiles.git"
GIT_V=`git --version`
if [ $? -ne 0 ]
then
echo "Git should be installed before proceeding. please install it and try again"
exit
fi
# Initialize Git repo in the home directory
$HOMEGIT init
# Add our repo
$HOMEGIT remote add origin $GIT_REPO
# Pull the contents
$HOMEGIT pull origin master
# Pull the submodules
$HOMEGIT submodule update --init --recursive
# Install VIM Plugins
vim +PluginInstall +qall
# Compile VIM YouCompleteMe
cd $HOME/.vim/bundle/YouCompleteMe
./install.sh
cd $HOME
# Change shell ot ZSH
chsh -s /bin/zsh
echo "Installation completed successfully."