33 lines
1 KiB
Bash
33 lines
1 KiB
Bash
#!/bin/bash
|
|
# Homebrew on Linux: install brew itself, then everything in the Brewfile.
|
|
# Brew owns the CLI toolchain so `brew upgrade` always gets latest versions.
|
|
|
|
BREW_PREFIX="/home/linuxbrew/.linuxbrew"
|
|
HOMEBREW_INSTALL_COMMIT="93a25fd2d2fdb86422303c292b9223f84ef23eaf"
|
|
HOMEBREW_INSTALL_SHA256="17f204b128869ec71e6b650051f1e65ef5b74cf994c2ff8b919103241554dd2f"
|
|
|
|
install_homebrew() {
|
|
if [[ -x $BREW_PREFIX/bin/brew ]]; then
|
|
info "Homebrew already installed"
|
|
else
|
|
info "Installing Homebrew..."
|
|
local installer
|
|
installer="$(mktemp)"
|
|
download_verified \
|
|
"https://raw.githubusercontent.com/Homebrew/install/$HOMEBREW_INSTALL_COMMIT/install.sh" \
|
|
"$HOMEBREW_INSTALL_SHA256" \
|
|
"$installer"
|
|
if ! NONINTERACTIVE=1 bash "$installer"; then
|
|
rm -f "$installer"
|
|
die "Homebrew installer failed"
|
|
fi
|
|
rm -f "$installer"
|
|
fi
|
|
eval "$("$BREW_PREFIX/bin/brew" shellenv)"
|
|
}
|
|
|
|
install_brew_packages() {
|
|
install_homebrew
|
|
info "Installing Brewfile bundle..."
|
|
brew bundle --file="$DOTFILES_DIR/install/Brewfile"
|
|
}
|