-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·64 lines (50 loc) · 1.41 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·64 lines (50 loc) · 1.41 KB
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
#!/usr/bin/env bash
# Exit on errors
set +o errexit
# ------------------------ Variables -------------------------------
DOTFILES_DIR="$HOME/.dotfiles"
# ANSI color codes
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No color
# Function to print colored text
print_color() {
local color="$1"
local message="$2"
echo -e "${color}${message}${NC}"
}
# ------------------------ Clone repo -------------------------------
# Checkout .dotfiles if it does not exist
if [ -d $DOTFILES_DIR ]; then
print_color "$YELLOW" "$DOTFILES_DIR exists, skipping"
else
print_color "$GREEN" "$DOTFILES_DIR does not exist, checking the repository out"
git clone https://github.com/Michaelpalacce/.dotfiles.git $DOTFILES_DIR
fi
# ------------------- Helper Functions -------------------------------
pushd $DOTFILES_DIR
for helper in ./setup/00-helpers/*; do
. $helper
done
popd
# ------------------------ Setup -------------------------------
pushd $DOTFILES_DIR
# Run dependency scripts
for deps_script in ./setup/05-deps/*; do
. $deps_script
done
# Run pre scripts
for pre_script in ./setup/10-pre/*; do
. $pre_script
done
# Run app scripts
for apps_file in ./setup/30-apps/*; do
. $apps_file
done
# Run post scripts
for post_script in ./setup/40-post/*; do
. $post_script
done
popd