gvm icon indicating copy to clipboard operation
gvm copied to clipboard

install gvm using zsh still update bashrc

Open crimson-gao opened this issue 3 years ago • 2 comments

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

crimson-gao avatar Sep 12 '22 20:09 crimson-gao

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

janeklb avatar Dec 26 '22 13:12 janeklb

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

ankitcharolia avatar Aug 05 '23 15:08 ankitcharolia