forked from tony/.dot-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·73 lines (64 loc) · 1.7 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
#!/bin/sh
# Tested on FreeBSD 11-CURRENT and Ubuntu 15.10
__gather_os_info() {
OS_NAME=$(uname -s 2>/dev/null)
OS_NAME_L=$( echo "$OS_NAME" | tr '[:upper:]' '[:lower:]' )
OS_VERSION=$(uname -r)
# shellcheck disable=SC2034
OS_VERSION_L=$( echo "$OS_VERSION" | tr '[:upper:]' '[:lower:]' )
}
__gather_os_info
if [ ! -d $HOME/Downloads ]; then
mkdir ~/Downloads
fi
if [ ! "$(command -v git)" != "" ]; then
case ${OS_NAME_L} in
freebsd )
su - root -c "pkg install git"
;;
linux )
sudo apt-get install git
;;
esac
fi
if [ ! "$(command -v python)" != "" ]; then
case ${OS_NAME_L} in
freebsd )
su - root -c "pkg install python"
;;
esac
fi
if [ ! "$(command -v pip)" != "" ]; then
echo "pip not installed"
if [ ! -f $HOME/Downloads/get-pip.py ]; then
case ${OS_NAME_L} in
freebsd )
cd ~/Downloads && fetch https://bootstrap.pypa.io/get-pip.py
;;
linux )
cd ~/Downloads && wget https://bootstrap.pypa.io/get-pip.py
;;
esac
fi
case ${OS_NAME_L} in
freebsd )
su - root -c "python3 $HOME/Downloads/get-pip.py"
;;
linux )
sudo python3 $HOME/Downloads/get-pip.py
;;
esac
fi
if [ ! "$(python -c 'import dotfiles' >/dev/null 2>&1)" ]; then
pip install --user dotfiles
fi
if [ ! "$(python -c 'import tmuxp' >/dev/null 2>&1)" ]; then
pip install --user tmuxp vcspull virtualenv pipenv setuptools python-language-server
fi
if [ ! -d $HOME/.dot-config ]; then
git clone --recursive https://github.com/tony/.dot-config ~/.dot-config
fi
ln -sf ~/.dot-config/.dotfilesrc ~/.dotfilesrc
~/.local/bin/dotfiles --sync
ln -sf ~/.vim/.vimrc ~/.vimrc
ln -sf ~/.tmux/.tmux.conf ~/.tmux.conf