-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·151 lines (123 loc) · 4.89 KB
/
install.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/local/bin/bash
# -------------------------------------------------------------------------
# Installation
# -------------------------------------------------------------------------
# This script installs and configures the macOS with my personal settings.
#
# The script can be executed as many times you want because the
# installation process is idempotent.
#
# Usage:
# ./install.sh
#
# -------------------------------------------------------------------------
# Load functions that simplify the script
source ./installation/constants.sh
source ./installation/helpers.sh
# -------------------------------------------------------------------------
# Command line tools
# -------------------------------------------------------------------------
# First, it installs homebrew and mas, which allow to install the other
# applications on macOS.
#
# The command line that cannot be installed with homebrew or mas, are
# installed through install_cli or asdf_install:
#
# install_cli <name> <install_operation> <condition_to_install>
# asdf_install <name> <command_provided_by_tool>
#
# -------------------------------------------------------------------------
install_cli "macOS command line tools" \
"xcode-select --install" \
'[[ "$(xcode-select -p)" == "" ]]'
install_homebrew
install_cli "Mas" "brew install mas" "! command -v mas"
install_cli "Asdf" "brew install asdf" "! command -v asdf"
install_cli "Bash" "brew install bash" "! command -v /usr/local/bin/bash"
install_cli "Zsh" "brew install zsh" "! command -v zsh"
install_cli "Oh-my-zsh" \
'sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"' \
'[ ! -d "$HOME/.oh-my-zsh" ]'
install_cli "Antibody" \
"brew install getantibody/tap/antibody" \
"! command -v antibody"
install_cli "Starship" \
"brew install starship" \
"! command -v starship"
# Dependencies
install_cli "Openssl" "brew install openssl" "! command -v openssl"
install_cli "Autoconf" "brew install autoconf" "! command -v autoconf"
install_cli "Automake" "brew install automake" "! command -v automake"
install_cli "Libtool" "brew install libtool" "! command -v libtool"
# Progamming languages
install_cli "Python 2.7" "brew install python@2" "! command -v python2.7"
install_cli "Python 3" "brew install python" "! command -v python3"
install_cli "Node" "brew install node" "! command -v npm"
install_cli "Go" "brew install go" "! command -v go"
install_cli "Rust" \
"curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh" \
"! command -v cargo"
asdf_install ruby irb
asdf_install erlang erl
asdf_install elixir iex
# Tools
install_cli "bat" "brew install bat" "! command -v bat"
install_cli "tldr" "brew install tldr" "! command -v tldr"
install_cli "sd" "cargo install sd" "! command -v sd"
install_cli "fzf" \
"brew install fzf && $(brew --prefix)/opt/fzf/install" \
"! command -v fzf"
install_cli "Diff-so-fancy" \
"brew install diff-so-fancy" \
"! command -v diff-so-fancy"
install_cli "Du+Rust" \
"cargo install du-dust" \
"! command -v dust"
# Vim
install_cli "NeoVim" \
"brew install neovim && pip3 install neovim" \
"! command -v nvim"
install_cli "Vim Plug" \
'curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' \
"[ ! -f ~/.vim/autoload/plug.vim ]"
# -------------------------------------------------------------------------
# Configurations
# -------------------------------------------------------------------------
if [ ! -d $HOME/.config ]; then
mkdir $HOME/.config
fi
for DOTFILE_PATH in ${!CONFIG_PATHS[@]}; do
link $DOTFILE_PATH ${CONFIG_PATHS[$DOTFILE_PATH]}
done
# Fira code font
info "Installing fira-code font..."
brew tap homebrew/cask-fonts > /dev/null 2>&1
brew cask install font-fira-code > /dev/null 2>&1
success "Successfully installed fira-code."
# -------------------------------------------------------------------------
# Applications
# -------------------------------------------------------------------------
# All applications are installed through brew or mas command.
# Therefore, the syntax to install a new app is:
#
# brew_install_app <app_name> <brew_cask_id>
# mas_install_app <app_name>
#
# -------------------------------------------------------------------------
brew_install_app "Visual Studio Code" "visual-studio-code"
brew_install_app "Slack" "slack"
brew_install_app "Firefox" "firefox"
brew_install_app "Spotify" "spotify"
brew_install_app "iTerm" "iterm2"
brew_install_app "Spectacle" "spectacle"
brew_install_app "Postman" "postman"
brew_install_app "Docker" "docker"
brew_install_app "Tunnelblick" "tunnelblick"
brew_install_app "VLC" "vlc"
brew_install_app "Discord" "discord"
brew_install_app "WhatsApp" "whatsapp"
brew_install_app "Rectangle" "rectangle"
mas_install_app "Spark"
mas_install_app "Messenger"
zsh