moovweb / gvm

Go Version Manager
http://github.com/moovweb/gvm
MIT License
9.88k stars 520 forks source link

install gvm using zsh still update bashrc #415

Open crimson-gao opened 1 year ago

crimson-gao commented 1 year ago

Here my zsh version is zsh 5.9 (x86_64-pc-linux-gnu), gvm version is v1.0.22. And I'm using oh-my-zsh. After install gvm, gvm updates my profile .bashrc, not .zshrc I use env | grep -i zsh, it prints

SHELL=/usr/bin/zsh
ZSH=/home/crimson/.oh-my-zsh

It seems there is no ZSH_NAME environment variable, but ZSH Instead. It's ok for me to copy the code from bashrc to zshrc, but it would be better if got fixed. Here is a piece of code from gvm:

if [ -z "$GVM_NO_UPDATE_PROFILE" ] ; then
  if [ -n "$ZSH_NAME" ]; then
    update_profile "$HOME/.zshrc"
  elif [ "$(uname)" == "Linux" ]; then
    update_profile "$HOME/.bashrc" || update_profile "$HOME/.bash_profile"
  elif [ "$(uname)" == "Darwin" ]; then
    update_profile "$HOME/.profile" || update_profile "$HOME/.bash_profile"
  fi
fi
janeklb commented 1 year ago

Did you install using zsh or bash?

See https://github.com/moovweb/gvm#installing

Or if you are using zsh just change bash with zsh

ankitcharolia commented 11 months ago

@crimson-gao kindly try this GO Version Manager: https://github.com/ankitcharolia/goenv