Skip to content

Commit

Permalink
Don't fail on macOS if brew is not available (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
wknapik authored Dec 16, 2024
1 parent 6f3c4a4 commit 929eb8a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,30 @@ main() {
elif [ "$os" = Darwin ]; then
if available brew; then
NONINTERACTIVE=1 show brew install --cask brave-browser
echo "Installation complete! Start Brave by typing: open -a Brave\ Browser"
else
error "Could not find brew. Please install brew to proceed." ""\
"A Brave .dmg can also be downloaded from https://brave.com/download/"
if available curl || available wget; then
dmg="$(mktemp ~/Downloads/Brave-Browser-XXXXXXXX.dmg)"
show $curl -L https://laptop-updates.brave.com/latest/osx >"${dmg:?}"
show open "$dmg"
else
show open https://laptop-updates.brave.com/latest/osx
fi
echo "Please follow the usual installation steps with the downloaded Brave-Browser.dmg"
fi

else
error "Could not find a supported package manager. Only apt, dnf, eopkg, paru/pikaur/yay, yum and zypper are supported." "" \
"If you'd like us to support your system better, please file an issue at" \
"https://github.com/brave/install.sh/issues and include the following information:" "" \
"$(uname -srvmo)" "" \
"$(cat /etc/os-release)"
"$(cat /etc/os-release || true)"
fi

printf "Installation complete! Start Brave by typing "
case "$os" in
Darwin) echo "open -a Brave\ Browser";;
*) basename "$(command -v brave-browser || command -v brave)";;
esac
if [ "$os" != Darwin ]; then
printf "Installation complete! Start Brave by typing: "
basename "$(command -v brave-browser || command -v brave)"
fi
}

# Helpers
Expand Down

0 comments on commit 929eb8a

Please sign in to comment.