-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·130 lines (103 loc) · 4.18 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
119
120
121
122
123
124
125
126
127
128
129
130
#!/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 test -L "$HOME/.gitignore_global"; then
echo_item "Git config files already linked" green
elif get_boolean_response "Do you want to install the Git configuration files?"
then
ln -sf "$DOTFILES/git/gitignore_global" "$HOME/.gitignore_global"
echo_item "Linked global .gitignore" "green"
ln -sf "$DOTFILES/git/gitconfig" "$HOME/.gitconfig"
echo_item "Linked gitconfig" "green"
else
echo_item "Ignoring Git configuration" red
fi
echo ""
# -- Python -----------------------------------------------------------------------
if exists "python"; then
if get_boolean_response "Do you want to install python package manager pip ?"; then
curl https://bootstrap.pypa.io/get-pip.py -o ~/get-pip.py
python ~/get-pip.py --user
rm ~/get-pip.py
else
echo_item "Skip pip install" red
fi
else
echo_item "Python is not installed, skip related stuff" red
fi
echo ""
# -- BASH Setup ----------------------------------------------------------------
if test -L "$HOME/.bash_profile"; then
echo_item "Bash profile is already linked" green
elif get_boolean_response "Do you want to install Bash configuration files?"
then
# -- BASH PROFILE
ln -sf "$DOTFILES/bash/bash_profile" "$HOME/.bash_profile"
echo_item "Linked bash_profile" "green"
else
echo_item "Ignoring Bash configuration" "red"
fi
echo ""
# # -- TMUX ----------------------------------------------------------------------
# For now, handled by chezmoi
# if test -L "$HOME/.tmux.conf"; then
# echo_item "Tmux configuration already linked" green
# elif get_boolean_response "Do you want to install the Tmux configuration file?"
# then
# ln -sf "$DOTFILES/tmux/tmux.conf" "$HOME/.tmux.conf"
# echo_item "Linked tmux configuration" "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 (nvm) ?"; then
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout "$(git describe --abbrev=0 --tags)"
source "$HOME/.nvm/nvm.sh"
nvm alias default system
else
echo_item "Skipping Node.js tools install" red
fi
fi
echo ""
# -- VSCode ----------------------------------------------------------------------
if exists "code"; then
if get_boolean_response "You have VSCode installed, want to add some recommended extension ?"; then
code --install-extension editorconfig.editorconfig
code --install-extension dbaeumer.vscode-eslint
code --install-extension danielo515.danielo-node-snippets
code --install-extension robertohuertasm.vscode-icons
code --install-extension jpoissonnier.vscode-styled-components
code --install-extension lxspandora.vscode-styled-components-snippets
code --install-extension wooodhead.disable-eslint-rule
else
echo_item "Skip VSCode extensions installation" red
fi
else
echo_item "VSCode not installed, skipping extensions installation" red
fi
# -- 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 NeoVim configuration file?"
then
ln -sf "$DOTFILES/nvim/init.vim" "$HOME/.config/nvim/init.vim"
echo_item "Linked Neovim configuration" "green"
ln -sf "$DOTFILES/nvim/colors" "$HOME/.config/colors/nvim/colors"
echo_item "Linked Neovim colors" "green"
else
echo_item "Ignoring Neovim configuration" red
fi
echo ""