-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap.sh
executable file
·46 lines (37 loc) · 1.39 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
41
42
43
44
45
46
#!/bin/bash
# Define variables
DOTFILES_REPO="https://github.com/edheltzel/dotfiles.git"
PROJECTS_DIR="$HOME/Developer"
DOTFILES_DIR="$HOME/.dotfiles"
# Define functions for prompts, banners, and errors
print_prompt() {
echo -e "\033[1m$1\033[0m"
}
function print_banner() {
local message="$1"
echo -e "${YELLOW}====================================================${NC}"
echo -e "${YELLOW} NOTE: $message${NC}"
echo -e "${YELLOW}====================================================${NC}"
}
print_error() {
local message="$1"
echo -e "${YELLOW}====================================================${NC}"
echo -e "${YELLOW} ERROR: $message${NC}"
echo -e "${YELLOW}====================================================${NC}"
}
##
# Create the Developer directory if it does not exist
if [ ! -d "$PROJECTS_DIR" ]; then
mkdir "$PROJECTS_DIR"
fi
# Clone the dotfiles repository
if ! git clone $DOTFILES_REPO $DOTFILES_DIR &> /dev/null; then
print_error "Failed to clone dotfiles repository. Please check your internet connection and try again."
exit 1
fi
# Run the installation script in the dotfiles directory
if ! bash $DOTFILES_DIR/install.sh &> /dev/null; then
print_error "Failed to install dotfiles. Please check the installation script and try again."
exit 1
fi
print_banner "You should restart your computer at this point for all the changes to take effect."