Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installApps ensures brew is initialized and on path #28

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ function writeGitConfig {
done
}

function initBrew {
case `uname` in
'Darwin') eval "$(/opt/homebrew/bin/brew shellenv)" ;;
'Linux') eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" ;;
esac
}

function ensureBrew {
if have brew; then
echo "$(brew --version) is installed"
Expand All @@ -80,11 +87,7 @@ function ensureBrew {
# https://brew.sh/
# https://docs.brew.sh/Homebrew-on-Linux
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
case `uname` in
'Darwin') eval "$(/opt/homebrew/bin/brew shellenv)" ;;
'Linux') eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" ;;
esac
# TODO: Test brew install
initBrew
}

function cloneDotFiles {
Expand Down Expand Up @@ -133,6 +136,7 @@ function installApps {

local var _apps=${apps[*]}
echo ">> brew install $_apps"
initBrew
brew install $_apps
if [ $? -ne 0 ] ; then
echo "Failed to install apps via brew"
Expand Down