-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·61 lines (51 loc) · 1.44 KB
/
install
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
#!/usr/bin/env bash
# determine the package manager
if [ -f /etc/os-release ]; then
source /etc/os-release
if [ "$ID" = "debian" ] || [ "$ID" = "ubuntu" ]; then
package_manager="apt"
elif [ "$ID" = "centos" ]; then
package_manager="yum"
elif [ "$ID" = "fedora" ]; then
package_manager="dnf"
elif [ "$ID" = "opensuse" ] || [ "$ID" = "opensuse-leap" ]; then
package_manager="zypper"
elif [ "$ID" = "arch" ] || [ "$ID" = "manjaro" ]; then
package_manager="pacman"
else
echo "Distribution non prise en charge."
exit 1
fi
else
echo "Impossible de déterminer la distribution."
exit 1
fi
installation_command="sudo $package_manager"
if [ "$package_manager" == "pacman" ]; then
installation_command="$installation_command -S "
else
installation_command="$installation_command install "
fi
# install git if not already installed
if ! command -v git &> /dev/null; then
$installation_command git
else
echo "git est déjà installé."
fi
# clone the repository
# git clone [email protected]:ZiplEix/dotfile.git ~/.dotfiles
# go to the repository
cd ~/.dotfiles
# install gnu stow if not already installed
if ! command -v stow &> /dev/null; then
$installation_command stow
else
echo "stow est déjà installé."
fi
# create the symbolic links
stow .
# setup ZSH & oh my zsh
./script/setup_zsh.zsh
# setup nvm & node
./script/setup_nvm.zsh
./script/setup_node.zsh