Skip to content

Commit

Permalink
Update brew formulaes provisioning script (#7)
Browse files Browse the repository at this point in the history
This commit improves the brew formulaes provisioning script by
checking existence of `brew` command before execution and also
by adding informational messages after installing GNU utilities.
The messages follow the content found in the following Pull
Request on GitHub: mathiasbynens/dotfiles#871
  • Loading branch information
addianto committed Aug 20, 2019
1 parent 40483fa commit 687ca94
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions brew.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env bash
# Install CLI tools using Homebrew
# Provisions libraries and software packages using Homebrew.
# Inspired by: https://github.com/mathiasbynens/dotfiles/blob/master/brew.sh

# Make sure we are using the latest Homebrew
brew update
if ! [ -x "$(command -v brew)" ]; then
echo 'Error: `brew` is not installed.' >&2;
exit 1;
fi

# Upgrade any already-installed packages
brew upgrade
Expand All @@ -12,17 +14,20 @@ brew upgrade
BREW_PREFIX=$(brew --prefix)

# Install GNU core utilities (those that come with macOS are outdated)
echo 'Be sure to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.'
brew install coreutils
ln -s "${BREW_PREFIX}/bin/gsha256sum" "${BREW_PREFIX}/bin/sha256sum"

# Install some other useful utilities like `sponge`
brew install moreutils
brew install findutils
echo 'Add `$(brew --prefix findutils)/libexec/gnubin` to `$PATH` if you would prefer these be the defaults'

# Install GNU `sed`, overwriting the built-in `sed`
brew install gnu-sed
echo 'Be sure to add `$(brew --prefix gnu-sed)/libexec/gnubin` to `$PATH`.'

# Install Bash 4
# Install Bash 5
brew install bash
brew install bash-completion2

Expand All @@ -32,6 +37,9 @@ if ! fgrep -q "${BREW_PREFIX}/bin/bash" /etc/shells; then
chsh -s "${BREW_PREFIX}/bin/bash";
fi;

# Install wget
brew install wget

# Install GnuPG to enable PGP-signing commits
brew install gnupg

Expand Down

0 comments on commit 687ca94

Please sign in to comment.