forked from pedroseabra1091/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·117 lines (94 loc) · 3.09 KB
/
install
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
BLUE='\033[1;34m'
GREEN='\033[1;32m'
RED='\033[0;31m'
RESET='\033[0m'
function xecho {
echo "\n$1[$2]: $3"
}
function xecho_info {
xecho "$BLUE" "$1" "$2"
}
function xecho_success {
xecho "$GREEN" "$1" "$2"
}
function xecho_error {
xecho "$RED" "$1" "$2"
}
# Optional flags
skip_dock_setup=false
while [[ "$#" -gt 0 ]]; do
case $1 in
--skip-dock-setup | -s) skip_dock_setup=true ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
if [ ! $(command -v brew) ]; then
xecho_info "install" "Installing brew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
xecho_info "update" "Update brew"
brew update
fi
xecho_info "brew" "Setup brew path"
if uname -a | grep -q arm; then
export PATH="/opt/homebrew/bin:$PATH"
export BREW_PATH="/opt/homebrew/bin"
else
export PATH="/usr/local/bin:$PATH"
export BREW_PATH="/usr/local/bin"
fi
xecho_info "brew" "Bundling formulaes & casks"
brew bundle install
if [ ! -d ~/.oh-my-zsh ]; then
xecho_info "zsh" "Install oh-my-zsh"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
if [ ! -d ~/.powerlevel10k ]; then
xecho_info "zsh" "Install p10k"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.powerlevel10k
fi
xecho_info "zsh" "Symlink p10k config"
ln -s -i $(pwd)/p10k/p10k.zsh.symlink ~/.p10k.zsh
xecho_info "zsh" "Symlink zshrc"
ln -s -i $(pwd)/zsh/zshrc.symlink ~/.zshrc
source ~/.zshrc
xecho_info "asdf" "Adding ASDF plugins"
asdf plugin-add elixir
asdf plugin-add erlang
asdf plugin-add kubectl
asdf plugin-add nodejs
asdf plugin-add postgres
asdf plugin-add redis
asdf plugin-add ruby
xecho_info "asdf" "Symlink .tool-versions"
ln -s -i $(pwd)/asdf/tool-versions.symlink ~/.tool-versions
(cd ~/ && asdf install)
xecho_info "asdf" "Symlink .asdf-postgres—configure-options"
ln -s -i $(pwd)/asdf/asdf-postgres-configure-options.symlink ~/.asdf-postgres-configure-options
xecho_info "git" "Symlink .gitconfig"
ln -s -i $(pwd)/git/gitconfig.symlink ~/.gitconfig
if [ -f "$BREW_PATH/code" ]; then
cat code/vscode-extensions.list | grep -v '^#' | xargs -L1 "$BREW_PATH/code" --install-extension
xecho_info "code" "Installing extensions"
else
xecho_error "code" "Couldn't install extensions"
fi
xecho_info "code" "Symlink keybindings.json"
ln -s -i $(pwd)/code/keybindings.json.symlink ~/Library/Application\ Support/Code/User/keybindings.json
xecho_info "code" "Symlink settings.json"
ln -s -i $(pwd)/code/settings.json.symlink ~/Library/Application\ Support/Code/User/settings.json
if [ -d "~/.config/karabiner" ]; then
xecho_info "karabiner" "Symlink karabiner.json"
ln -s -i $(pwd)/karabiner/karabiner.json.symlink ~/.config/karabiner/karabiner.json
else
xecho_error "karabiner" "Couldn't symlink karabiner configuration – Repeat execution once access privileges are granted to Karabiner."
fi
if [ $skip_dock_setup == true ]; then
xecho_info "macos" "Skipping dock setup"
else
xecho_info "macos" "Set dock"
chmod +x macos/set_dock.sh
sh -c macos/set_dock.sh
fi