chore: macOS setup skips installed tools and brew failures
This commit is contained in:
@@ -16,8 +16,41 @@ if ! command -v brew >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
brew install \
|
||||
git wget flex bison gperf python cmake ninja ccache dfu-util libusb libffi openssl@3
|
||||
ensure_brew_pkg() {
|
||||
local pkg="$1"
|
||||
if brew list --formula --versions "$pkg" >/dev/null 2>&1; then
|
||||
echo "brew: $pkg already installed, skipping"
|
||||
else
|
||||
if ! brew install "$pkg"; then
|
||||
echo "warn: failed to install $pkg via brew; continuing" >&2
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_brew_pkg_if_missing_cmd() {
|
||||
local pkg="$1"
|
||||
local cmd="$2"
|
||||
if command -v "$cmd" >/dev/null 2>&1; then
|
||||
echo "cmd: $cmd already available, skipping brew $pkg"
|
||||
else
|
||||
ensure_brew_pkg "$pkg"
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_brew_pkg_if_missing_cmd git git
|
||||
ensure_brew_pkg_if_missing_cmd wget wget
|
||||
ensure_brew_pkg_if_missing_cmd flex flex
|
||||
ensure_brew_pkg_if_missing_cmd bison bison
|
||||
ensure_brew_pkg_if_missing_cmd gperf gperf
|
||||
ensure_brew_pkg_if_missing_cmd python python3
|
||||
ensure_brew_pkg_if_missing_cmd cmake cmake
|
||||
ensure_brew_pkg_if_missing_cmd ninja ninja
|
||||
ensure_brew_pkg_if_missing_cmd ccache ccache
|
||||
ensure_brew_pkg_if_missing_cmd dfu-util dfu-util
|
||||
ensure_brew_pkg libusb
|
||||
ensure_brew_pkg libffi
|
||||
ensure_brew_pkg openssl@3
|
||||
|
||||
mkdir -p "$ESP_ROOT"
|
||||
if [[ ! -d "$IDF_DIR/.git" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user