-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote-install.sh
executable file
·56 lines (47 loc) · 1.09 KB
/
remote-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
#!/usr/bin/env bash
DOTFILES="$HOME/.dotfiles"
GITHUB_REPO_URL="https://github.com/ExtinctAxolotl/dotfiles"
info() {
echo -e "${YELLOW}${*}${RESET}"
}
success() {
echo -e "${GREEN}${*}${RESET}"
}
install_app() {
info "Trying to find ${1}"
if ! is_installed_pkg $1; then
read -p "Do you wan't to install $1? [y/N] " -n 1 answer
if [ ${answer} == "y" ]; then
info "Installing ${1}..."
sudo apt install $1
else
info "${1} Will not be installed!\nSkipping...\n"
sleep 1
fi
else
success "${1} is already installed!\nSkipping...\n"
sleep 1
fi
}
is_installed_pkg() {
command -v $1 >/dev/null 2>&1
}
install_dotfiles() {
info "Trying to detect if dotfiles are installed..."
if [ ! -d $DOTFILES ]; then
info "Dotfiles don't exist..."
if is_installed_pkg git; then
read -p "Do you wan't to install dotfiles? [y/N]" -n 1 answer
if [ ${answer} != "y" ]; then
exit 1
fi
info "Installing Dotfiles..."
git clone "$GITHUB_REPO_URL.git" $DOTFILES
else
info "Seems like git isn't installed!"
install_app git
fi
fi
}
install_dotfiles
$DOTFILES/install.sh