MacOS fixes
This commit is contained in:
@@ -46,7 +46,7 @@ detect_arch() {
|
||||
|
||||
install_tool() {
|
||||
local tool="$1"
|
||||
local platform arch version owner repo asset binary_rel formula url tmp_dir archive_path extracted_path target_path installed_path
|
||||
local platform arch version owner repo asset binary_rel formula url tmp_dir archive_path extracted_path target_path installed_path formula_prefix
|
||||
|
||||
platform="$(detect_platform)"
|
||||
arch="$(detect_arch)"
|
||||
@@ -74,7 +74,13 @@ install_tool() {
|
||||
printf '%s already installed via Homebrew\n' "$tool"
|
||||
fi
|
||||
|
||||
installed_path="$(command -v "$tool" || true)"
|
||||
formula_prefix="$(brew --prefix "$formula" 2>/dev/null || true)"
|
||||
if [ -n "$formula_prefix" ] && [ -x "$formula_prefix/bin/$tool" ]; then
|
||||
installed_path="$formula_prefix/bin/$tool"
|
||||
else
|
||||
installed_path="$(command -v "$tool" || true)"
|
||||
fi
|
||||
|
||||
if [ -z "$installed_path" ]; then
|
||||
printf 'Installed formula %s but %s is not on PATH\n' "$formula" "$tool" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user