forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
executable file
·42 lines (35 loc) · 1.4 KB
/
setup
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
#!/usr/bin/env bash
# Uncomment this next line and commit the change to make dotfile installs into
# any new codespaces a no-op. Useful for debugging devcontainer builds without
# worrying about whether your dotfiles are causing issues.
# [[ -n "${CODESPACES:-}" ]] && exit 0
original_args="$@"
cd "$(dirname "$0")"
[[ -n "${DEBUG:-}" ]] && echo -e "\033[90mSourcing runtime script\033[0m" || true
source ./scripts/helpers/runtime.sh
[[ -n "${DEBUG:-}" ]] && echo -e "\033[90mSourcing trap and trace script\033[0m" || true
source ./bin/helpers/trap_and_trace.sh
log_info "Beginning setup"
log_debug "Sourcing sudo keep alive script"
source ./scripts/helpers/sudo-keep-alive.sh
log_info "Checking prerequisites"
if [[ "$(is_codespace)" != "true" ]]; then
log_debug "calling prerequisites script"
scripts/install-prerequisites
else
log_attention "Prerequisites mode not supported in Codespaces; skipping $0"
fi
if ! is_bootstrap_mode; then
log_debug "Checking runtime environment"
if [[ "$(is_codespace)" == "true" ]]; then
log_debug "calling bootstrap-codespaces script"
scripts/bootstrap-codespaces
elif [[ "$(is_macos)" == "true" || "$(is_linux)" == "true" ]]; then
log_debug "calling bootstrap-workstation script"
scripts/bootstrap-workstation
else
log_attention "Unrecognized environment; skipping $0"
fi
fi
log_debug "Finished running \`$0 ${original_args}\`"
log_success "Setup complete!"