-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·57 lines (44 loc) · 1.72 KB
/
bootstrap
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
#!/usr/bin/env bash
source ./common
[ -d "${DEV_HOME}" ] || mkdir -p "${DEV_HOME}"
sudo xcodebuild -license accept
xcode-select --install;
# set default shell to bash
# chsh -s /bin/bash
# bootstrap homebrew
exists-in-path brew || /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew deps
brew update
brew bundle --file="${REPO_PATH}/brew/Brewfile"
# setup environment links
symlink-src-to-target "${REPO_PATH}/vimrc" "${HOME}/.vimrc"
symlink-src-to-target "${REPO_PATH}/ideavimrc" "${HOME}/.ideavimrc"
symlink-src-to-target "${REPO_PATH}/bash_profile" "${HOME}/.bash_profile"
symlink-src-to-target "${REPO_PATH}/profile.sh" "${HOME}/.profile"
symlink-src-to-target "${REPO_PATH}/gitconfig" "${HOME}/.gitconfig"
symlink-src-to-target "${REPO_PATH}/gitignore" "${HOME}/.gitignore"
# link bin files
[ -d "${MY_BIN}" ] || mkdir "${MY_BIN}"
while read -r SCRIPT_SRC; do
if [[ -x ${SCRIPT_SRC} ]]; then
symlink-src-to-target "${SCRIPT_SRC}" "${MY_BIN}/$(basename "${SCRIPT_SRC}")"
else
echo-err "Did not link ${SCRIPT_SRC} because it's not marked as executable"
fi
done < <(find "${REPO_PATH}/bin" -type f -maxdepth 1 -mindepth 1)
# profile contains some shims
# need to do this for pyenv and nvm below
source "${REPO_PATH}/profile.sh"
# setup python environment
./pyenv-versions
# setup node environment
./nvm-versions
# setup ruby environment
# ./rbenv-versions
# setup vim environment
./vim-plugins
# install vscode extensions
if [[ -e ${REPO_PATH}/vscode.extensions ]]; then
# cat "${REPO_PATH}/vscode.extensions" | xargs -P4 -I{} code --install-extension {}
xargs -P4 -I{} code --force --install-extension {} < "${REPO_PATH}/vscode.extensions"
fi