From 2f0fa7783187e967fa4a45bb2763b52e03b18f5e Mon Sep 17 00:00:00 2001 From: Brooke Kuhlmann Date: Sat, 25 Feb 2023 08:51:41 -0700 Subject: [PATCH] Fixed programs without extensions to install to user directory Necessary to ensure the Homebrew directory remains clean and is *only* managed by Homebrew. All other programs are downloaded straight from the provider and placed in the `/usr/local/bin` instead. --- lib/utilities.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/utilities.sh b/lib/utilities.sh index bbfbae3..0c739e0 100644 --- a/lib/utilities.sh +++ b/lib/utilities.sh @@ -77,18 +77,10 @@ export -f get_install_path # Parameters: $1 (required) - The file name. get_install_root() { local file_name="$1" - local file_extension=$(get_extension "$file_name") - # Special cases not supported by Homebrew. - if [[ "$file_name" == "elm" ]]; then - printf "/usr/local/bin" - return - fi - - # Dynamically build the install path based on file extension. - case $file_extension in + case $(get_extension "$file_name") in '') - printf "$(get_homebrew_bin_root)";; + printf "/usr/local/bin";; 'app') printf "/Applications";; 'prefPane')