sorin-ionescu / prezto

The configuration framework for Zsh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with env variables ($path variable)

abelevcov-bricklane opened this issue · comments

Description

After install everything on my MacBook Pro, I've lost HOMEBREW_PREFIX in environment variables and some tools i've lost, cause the $PATH var has been broken

Expected behavior

With commented part in .zprofile I've got correct behaviour

# path=(
#  $HOME/{,s}bin(N)
#  /opt/{homebrew,local}/{,s}bin(N)
#  /usr/local/{,s}bin(N)
#  $path
# )
+/Users/user_name/.zshrc:14> test -f /opt/homebrew/bin/brew
+/Users/user_name/.zshrc:14> /opt/homebrew/bin/brew shellenv
+/Users/user_name/.zshrc:14> eval $'export HOMEBREW_PREFIX="/opt/homebrew";\nexport HOMEBREW_CELLAR="/opt/homebrew/Cellar";\nexport HOMEBREW_REPOSITORY="/opt/homebrew";\nexport PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}";\nexport MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:";\nexport INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}";'
+(eval):1> export HOMEBREW_PREFIX=/opt/homebrew
+(eval):2> export HOMEBREW_CELLAR=/opt/homebrew/Cellar
+(eval):3> export HOMEBREW_REPOSITORY=/opt/homebrew
+(eval):4> export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/user_name/.fig/bin:/Users/user_name/.local/bin
+(eval):5> export MANPATH=/opt/homebrew/share/man::
+(eval):6> export INFOPATH=/opt/homebrew/share/info:

Actual behavior

with enabled debug set -x in my .zshrc and everything in place I'm getting following output:

+/Users/user_name/.zshrc:14> test -f /opt/homebrew/bin/brew
+/Users/user_name/.zshrc:14> /opt/homebrew/bin/brew shellenv
+/Users/user_name/.zshrc:14> eval ''
+/Users/user_name/.zshrc:16> echo

/opt/homebrew/bin/brew shellenv doesn't return anything to my environment

After some investigation, I've realised that the problem in file .zprofile in the following part:

path=(
  $HOME/{,s}bin(N)
  /opt/{homebrew,local}/{,s}bin(N)
  /usr/local/{,s}bin(N)
  $path
)

Steps to Reproduce

  1. Install prezto
  2. add set +x to .zshrc
  3. run env | grep HOMEBREW | sort

Versions

  • Prezto commit: master (fc444f5)
  • ZSH version: zsh 5.8.1 (x86_64-apple-darwin22.0)
  • OS information: MacOS 13.2.1