forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbrew.sh
More file actions
executable file
·30 lines (22 loc) · 750 Bytes
/
Copy pathbrew.sh
File metadata and controls
executable file
·30 lines (22 loc) · 750 Bytes
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
#!/usr/bin/env bash
# Install all homebrew packages inside Brewfile
# Check for Homebrew Installation
if ! which brew > /dev/null; then
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi;
# Update Homebrew
brew update
# Upgrade any already-installed formulae.
brew upgrade
# Install everything inside Brewfile
brew bundle
# Save Homebrew’s installed location.
BREW_PREFIX=$(brew --prefix)
# Switch to using brew-installed bash as default shell
if ! fgrep -q "${BREW_PREFIX}/bin/bash" /etc/shells; then
echo "${BREW_PREFIX}/bin/bash" | sudo tee -a /etc/shells;
chsh -s "${BREW_PREFIX}/bin/bash";
fi;
# Remove outdated versions from the cellar.
brew cleanup