-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·43 lines (35 loc) · 951 Bytes
/
setup.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
#!/usr/bin/env bash
#
# bootstrap installs things.
cd "$(dirname "$0")"
source ./core/paths.sh
source $DOTFILES_ZSH/utils/prints.sh
source $DOTFILES_ZSH/core/setup-dotfiles.sh
set -e
echo ''
# If we're on a linux, run dot to install dependencies
if [ "$(uname -s)" == "Linux" ]; then
info "Installing dependencies"
if source $DOTFILES_ZSH/bin/dot | while read -r data; do info "$data"; done; then
success "Dependencies installed"
else
fail "Error installing dependencies"
fi
fi
# Export variables defined in .env
while IFS='=' read -r key value; do
# if key and value not empty:
if [ -n "$key" ] && [ -n "$value" ]; then
export $key=$value
fi
done <.env
# Run all setup scripts
if source $DOTFILES_ZSH/scripts/setup-all.sh | while read -r data; do info "$data"; done; then
success "Setup scripts executed successfully."
else
fail "Error executing setup scripts."
fi
# Link all the dotfiles
setup_dotfiles
echo ''
echo ' Done!'