-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·53 lines (42 loc) · 1.29 KB
/
bootstrap.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.29 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
#!/bin/zsh
local LOG_PREFIX="[system bootstrap]:"
local DOTFILES_REPO="$HOME/.dotfiles"
local SCRIPTS="$DOTFILES_REPO/scripts"
local XDG_CONFIG_HOME="$HOME/.config"
local XDG_DATA_HOME="$HOME/.local/share"
local _run() {
local script="$SCRIPTS/$1.sh"
if [ -e $script ]; then
source $script
else
echo "ERROR: script $script not found!"
exit 1
fi
}
# ensure the process exits on any error
set -e
# Ask for the admin password upfront
echo "$LOG_PREFIX Requesting admin privileges..."
sudo -v
# load utility functions
source "$SCRIPTS/utils.sh"
# create dir for temporary files
mkdir -p $XDG_DATA_HOME
echo "$LOG_PREFIX Sit down and relax, system is going to be ready soon..."
# system bootstrap steps
_run check_sys_requirements
_run remove_current_dotfiles
_run install_and_setup_homebrew
_run install_packages
_run setup_ssh_keys
_run setup_github_account
_run setup_shell
_run install_shell_plugins
_run link_dotfiles
_run set_precommit_hook
_run setup_dev_env
_prompt_for_confirmation "Do you want to setup touch id for sudo access?"
if _has_confirmed; then _run enable-touchid-for-sudo-access done
# switch dotfiles repo from https protocol to SSH
cd $DOTFILES_REPO && git remote set-url origin git@github.com:Amheklerior/dotfiles-repo.git
echo "$LOG_PREFIX Done! You're ready to rock \m/"