forked from alexlafroscia/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·118 lines (89 loc) · 3.16 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
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
# Install .dotfiles
# -- Import from other scripts -------------------------------------------------
source 'scripts/helpers/colors.sh'
source 'scripts/helpers/functions.sh'
# -- OSX- or Linux-Specific Setup ----------------------------------------------
if system_is_OSX; then
source 'scripts/osx.sh'
elif system_is_linux; then
source 'scripts/ubuntu.sh'
fi
# -- GIT -----------------------------------------------------------------------
if get_boolean_response "Do you want to install the Git configuration files?"
then
ln -sf $HOME/.dotfiles/git/gitignore_global $HOME/.gitignore_global
echo_item "Linked global .gitignore" "green"
ln -sf $HOME/.dotfiles/git/gitconfig $HOME/.gitconfig
echo_item "Linked gitconfig" "green"
else
echo_item "Ignoring Git configuration" red
fi
echo ""
# -- ZSH Setup -----------------------------------------------------------------
if exists "zsh"; then
if get_boolean_response "Do you want to install ZSH configuration files?"; then
# -- ZSHRC
ln -sf $HOME/.dotfiles/zsh/zshrc $HOME/.zshrc
echo_item "Linked zshrc" "green"
# -- OH MY ZSH
if [ -d $HOME/.oh-my-zsh/ ]; then
echo_item "Oh my ZSH is already installed" "green"
else
if exists "curl"; then
curl -L http://install.ohmyz.sh | sh
elif exists "wget"; then
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
else
echo_item "You need either curl or wget installed to download Oh My ZSH"
fi
fi
else
echo_item "Ignoring ZSH configuration" "red"
fi
else
echo_item "ZSH is not installed"
fi
echo ""
# -- BASH Setup ----------------------------------------------------------------
if get_boolean_response "Do you want to install Bash configuration files?"; then
# -- BASH PROFILE
ln -sf $HOME/.dotfiles/bash/bash_profile $HOME/.bash_profile
echo_item "Linked bash_profile" "green"
else
echo_item "Ignoring Bash configuration" "red"
fi
echo ""
# -- TMUX ----------------------------------------------------------------------
if get_boolean_response "Do you want to install the Tmux configuration file?"
then
ln -sf $HOME/.dotfiles/tmux/tmux.conf $HOME/.tmux.conf
echo_item "Linked tmux configutation" "green"
else
echo_item "Ignoring Tmux configuration" "red"
fi
echo ""
# -- Node ----------------------------------------------------------------------
if exists "nvm"; then
echo_item "Node tools are already installed" green
else
if get_boolean_response "Do you want to install Node.js tools?"; then
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
. $HOME/.nvm/nvm.sh
nvm alias default system
else
echo_item "Skipping Node.js tools install" red
fi
fi
echo ""
# -- NEOVIM --------------------------------------------------------------------
# Link the dotfiles
# TODO: Ask if the user wants to copy the current configuration to a .local file
if get_boolean_response "Do you want to install the Neoim configuration file?"
then
ln -sf $HOME/.dotfiles/nvim $HOME/.config/nvim
echo_item "Linked Neovim configuration" "green"
else
echo_item "Ignoring Neovim configuration" red
fi
echo ""