-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_once_install_0101_brew.sh
More file actions
34 lines (32 loc) · 1.13 KB
/
Copy pathrun_once_install_0101_brew.sh
File metadata and controls
34 lines (32 loc) · 1.13 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
#!/usr/bin/env bash
###############################################################################
# Install Homebrew CLI #
###############################################################################
source ~/.local/share/chezmoi/helpers/echos.sh
source ~/.local/share/chezmoi/helpers/requirers.sh
running "checking homebrew install"
brew_bin=$(which brew) 2>&1 > /dev/null
if [[ $? != 0 ]]; then
action "installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
if [[ $? != 0 ]]; then
error "unable to install homebrew, script $0 abort!"
exit 2
fi
else
ok
# Make sure we’re using the latest Homebrew
running "updating homebrew"
brew update
ok
bot "before installing brew packages, we can upgrade any outdated packages."
read -r -p "run brew upgrade? [y|N] " response
if [[ $response =~ ^(y|yes|Y) ]];then
# Upgrade any already-installed formulae
action "upgrade brew packages..."
brew upgrade
ok "brews updated..."
else
ok "skipped brew package upgrades.";
fi
fi