-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_once_before_10-install-macos-dev-tools.sh.tmpl
More file actions
executable file
·50 lines (40 loc) · 1.54 KB
/
run_once_before_10-install-macos-dev-tools.sh.tmpl
File metadata and controls
executable file
·50 lines (40 loc) · 1.54 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
#!/usr/bin/env bash
set -euo pipefail
if [[ "$(uname -s)" != "Darwin" ]]; then
exit 0
fi
if ! xcode-select -p >/dev/null 2>&1; then
echo "Install Xcode Command Line Tools first:" >&2
echo " xcode-select --install" >&2
exit 1
fi
if ! command -v brew >/dev/null 2>&1; then
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
brew install neovim starship lazygit zellij
brew install --cask font-commit-mono-nerd-font
if brew list --cask visual-studio-code >/dev/null 2>&1 || [[ -d "/Applications/Visual Studio Code.app" ]]; then
echo "Visual Studio Code is already installed; skipping cask install."
else
brew install --cask visual-studio-code
fi
if [[ ! -d "$HOME/.oh-my-zsh" ]]; then
RUNZSH=no CHSH=no KEEP_ZSHRC=yes sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
if [[ ! -d "$HOME/.nvm" ]]; then
PROFILE=/dev/null bash -c "$(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh)"
fi
CODE_BIN=""
if command -v code >/dev/null 2>&1; then
CODE_BIN="$(command -v code)"
elif [[ -x "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" ]]; then
CODE_BIN="/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"
fi
if [[ -n "$CODE_BIN" ]]; then
"$CODE_BIN" --install-extension enkia.tokyo-night --force
fi