-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-macos-software.sh
executable file
·121 lines (106 loc) · 2.89 KB
/
install-macos-software.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
#!/usr/bin/env bash
HEADER=$'\e[1;93m' YELLOW=$'\e[93m' UNDERLINE=$'\e[4m' RESET=$'\e[0m'
HELP="
${HEADER}Install script for MacOS software ✨${RESET}
${UNDERLINE}https://github.com/rosvik/dotfiles${RESET}
When running or updating this script, keep in mind:
- It is safe to run several times, but some upgrades may happen when doing so.
- It does not require dotfiles to be installed, but some of the software
requires setup from dotfiles to work properly.
Some version managers are installed instead of specific languages:
- node: ${YELLOW}nvm install --lts && nvm use --lts${RESET}
- python: ${YELLOW}pyenv install 3.9 && pyenv global 3.9${RESET}
- ruby: ${YELLOW}rbenv install 2.7.6 && rbenv global 2.7.6${RESET}
- java: ${YELLOW}sdk install java 21.0.2-open${RESET}
"
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
echo -e "$HELP"
exit
fi
echo -e "$HELP"
print() {
echo -e "${YELLOW}\n $1${RESET}"
}
check_command_line_tools() {
xcode-select --install 2>/dev/null
return_code=$?
if [ $return_code -ne 0 ]; then
print "Seems like Command Line Tools is installed"
else
print "Seems like you need to install Command Line Tools"
print "Rerun the script when that is done"
exit 1
fi
}
check_command_line_tools "$@"
# Exit the script on errors from now on.
set -o errexit
main() {
print "Creating ~/bin (if not already present)"
mkdir -pv ~/bin
print "Installing yt-dlp"
curl --silent -L -o ~/bin/yt-dlp "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp" &&
chmod +x ~/bin/yt-dlp
if [ ! -f "/opt/homebrew/bin/brew" ]; then
print "Installing brew 🍺"
/bin/bash -c "$(curl --silent -SL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
print "Running brew update (brew is already installed) 🍺"
brew update
fi
print "Installing brew formulae 🍺"
formulae=(
"ffmpeg"
"fq"
"gh"
"git-crypt"
"gnupg"
"gtop"
"imagemagick"
"jq"
"neofetch"
"openssl"
"pyenv"
"rbenv"
"readline"
"ruby-build"
"sqlite3"
"tcl-tk"
"tree"
"xz"
"zlib"
"bat"
"micro"
"fzf"
"fd"
"ripgrep"
"zsh-autosuggestions"
)
for formula in "${formulae[@]}"; do
echo " - $formula"
brew install --quiet "$formula"
done
print "Installing brew casks 🍺"
casks=(
"bartender"
"bitwarden"
"hex-fiend"
"slack"
"spotify"
"vlc"
)
for cask in "${casks[@]}"; do
echo " - $cask"
brew install --cask --quiet "$cask"
done
print "Installing nvm"
PROFILE=/dev/null bash -c 'curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh | bash'
if [ ! -f "$HOME/.sdkman/bin/sdkman-init.sh" ]; then
print "Installing sdkman"
curl -s "https://get.sdkman.io" | bash
else
print "Skipping sdkman installation, since it's already installed"
fi
}
main "$@"
print "Done 🎉"