-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·58 lines (43 loc) · 1.21 KB
/
install
File metadata and controls
executable file
·58 lines (43 loc) · 1.21 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
#!/bin/bash
PROFILE=$1 # Accepts profile (e.g. personal, work)
export DOTFILES_ROOT=$(pwd -P)
source "$DOTFILES_ROOT/print_helper"
source "$DOTFILES_ROOT/helpers"
install_package() {
local package="$1"
if [ -f "$DOTFILES_ROOT/$package/install" ]; then
info "Installing package $package"
"$DOTFILES_ROOT/$package/install"
fi
}
setup_package() {
local package="$1"
if [ -f "$DOTFILES_ROOT/$package/setup" ]; then
info "Setting up package $package"
"$DOTFILES_ROOT/$package/setup"
fi
}
bundle_profile() {
local profile=$1
if [ -f "$DOTFILES_ROOT/profiles/$profile" ]; then
info "Bundling Brewfile for $profile profile"
./bundle "$profile"
info "Installing packages from \"$profile\" profile"
while read -r package; do
install_package "$package"
setup_package "$package"
done < "$DOTFILES_ROOT/profiles/$profile"
unset package
fi
}
info 'Initializing Git setup'
"$DOTFILES_ROOT/init_git_setup.sh"
info 'Installing homebrew'
"$DOTFILES_ROOT/homebrew/install"
bundle_profile "basic"
if [ -n "$PROFILE" ]; then
bundle_profile "$PROFILE"
# Save installation profile to load rc files
echo "$PROFILE" > "$DOTFILES_ROOT/.current_profile"
fi
success 'All done! :D'