Skip to content

Commit

Permalink
🐛 Update Homebrew path during setup scripts that was missing during s…
Browse files Browse the repository at this point in the history
…ubsequent steps

The method for setting up the Homebrew path on macOS has been changed. Instead of directly modifying the PATH variable, the 'brew shellenv' command is now used. This is a safer and more flexible method as it automatically sets the environment variables needed for Homebrew. This change provides better compatibility and reduces the risk of issues with different system configurations.
  • Loading branch information
wingy3181 committed Dec 3, 2023
1 parent bb88605 commit 408e827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/os/installs/macos/homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")" \

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

add_to_path() {
add_homebrew_to_path() {

# Check if `brew` is available.

Expand All @@ -29,7 +29,8 @@ add_to_path() {
print_error "Homebrew is only supported on Intel and ARM processors!"
fi

PATH="$prefix/bin:$PATH"
#PATH="$prefix/bin:$PATH"
eval "$($prefix/bin/brew shellenv)"

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Expand Down Expand Up @@ -110,7 +111,7 @@ main() {
print_in_purple "\n Homebrew\n\n"

install
add_to_path
add_homebrew_to_path
opt_out_of_analytics

update
Expand Down
1 change: 1 addition & 0 deletions src/os/installs/macos/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ main() {
./xcode.sh
./rosetta_2.sh
./homebrew.sh
. "./homebrew.sh" && add_homebrew_to_path
./../bash.sh

./git.sh
Expand Down

0 comments on commit 408e827

Please sign in to comment.