-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·40 lines (33 loc) · 1.01 KB
/
bootstrap.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
#!/usr/bin/env bash
# dotfiles bootstrapper
#
# Installs zsh & git, then clones this repo to ~/.dotfiles. This script is
# intended to be run remotely, via curl:
#
# bash <(curl -s https://gitlab.com/langurmonkey/dotfiles/raw/master/bootstrap.sh)
export DOTFILES=~/.dotfiles
set -e
_msg() { printf "\r\033[2K\033[0;32m[ .. ] %s\033[0m\n" "$*"; }
_uncallable() { ! command -v "$1" >/dev/null; }
if _uncallable zsh || _uncallable git; then
_msg "Installing git, zsh, neovim, lf, etc."
if [[ -f /etc/arch-release ]]; then
$DOTFILES/bootstrap-arch.sh
elif [[ -f /etc/debian_version ]]; then
$DOTFILES/bootstrap-deb.sh
fi
fi
if [[ ! -d ~/.dotfiles ]]; then
_msg "Deploying dotfiles repository..."
if [[ $USER == tsagrista ]]; then
dfrepo=git@gitlab.com:jumpinglangur/dotfiles.git
else
dfrepo=https://gitlab.com/langurmonkey/dotfiles.git
fi
git clone --recursive "$dfrepo" "$DOTFILES"
fi
#
_msg
_msg "And done!"
_msg
_msg "Use $DOTFILES/deploy to install your dotfiles"