建议统一修改.bashrc
在bash_profile和zsh后面追加 source ~/.bashrc

添加示例

.bashrc

  1. # 添加PATH并自动去重
  2. function addToPATH {
  3. case ":$PATH:" in
  4. *":$1:"*) :;; # already there
  5. *) PATH="$1:$PATH";; # or PATH="$PATH:$1"
  6. esac
  7. }
  8. addToPATH /Applications/AIRSDK_Compiler/bin
  9. addToPATH ~/.local/lib/npm/bin