From cf477024fc9f50b3b156e2fbe5a32cec4ac7d7da Mon Sep 17 00:00:00 2001 From: Stern Date: Fri, 8 Nov 2024 23:24:46 -0500 Subject: [PATCH] chore: Add checks to fetch-prebuilt script. This adds a check that if for example wget isn't installed it'll install from brew via brew install. Signed-off-by: Stern --- Dependencies/fetch-prebuilt.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Dependencies/fetch-prebuilt.sh b/Dependencies/fetch-prebuilt.sh index 35760b95..65c15a6a 100644 --- a/Dependencies/fetch-prebuilt.sh +++ b/Dependencies/fetch-prebuilt.sh @@ -3,6 +3,27 @@ # Ensure we are in Dependencies directory cd "$(dirname "$0")" +# Check if wget and curl are installed; if not, install them via Homebrew +if ! command -v wget &> /dev/null; then + echo "wget not found, attempting to install via Homebrew..." + if command -v brew &> /dev/null; then + brew install wget + else + echo "Homebrew is not installed. Please install Homebrew and rerun the script." + exit 1 + fi +fi + +if ! command -v curl &> /dev/null; then + echo "curl not found, attempting to install via Homebrew..." + if command -v brew &> /dev/null; then + brew install curl + else + echo "Homebrew is not installed. Please install Homebrew and rerun the script." + exit 1 + fi +fi + check_for_update() { if [ -f ".skip-prebuilt-fetch-$1" ]; then echo "Skipping prebuilt fetch for $1 since .skip-prebuilt-fetch-$1 exists. If you are developing $1 alongside SideStore, don't remove this file, or this script will replace your locally built binaries with the ones built by GitHub Actions."