avn icon indicating copy to clipboard operation
avn copied to clipboard

Incorrectly creates `.bash_profile` file on WSL Ubuntu

Open cdgriffith opened this issue 6 years ago • 4 comments

When using the windows subsystem for linux and installing avn it creates a .bash_profile. Doing so makes Ubuntu no longer load the .profile file and therefor no longer loads the .bashrc file.

Top of ~/.profile

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.

By default nvm is loaded into bashrc and I believe avn should be added below it.

Details

  • avn 0.2.4
  • node 10.16.3
  • nvm 0.34.0
  • bash 4.4.19

avn is loaded in my ~/.bash_profile file with:

[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn

nvm specific

  • [X] As an nvm user I am confirming that I did not install with Homebrew

cdgriffith avatar Sep 09 '19 20:09 cdgriffith

Can you find an example of another tool that does a better job with figuring out which script file to use based on platform? Something like RVM may be a good place to look. Then we can model after work that's already been done.

wbyoung avatar Sep 12 '19 15:09 wbyoung

I’d be interested in a reliable algorithm for nvm’s own install script; I’ve yet to find one.

ljharb avatar Sep 12 '19 15:09 ljharb

There's open PR for that: https://github.com/wbyoung/avn/pull/51.

evenfrost avatar Nov 13 '19 14:11 evenfrost

Just to mention the obvious, till the time the PR #51 is ready, WSL users can delete ~/.bash_profile and add [[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn to the end of ~/.profile.

musahaidari avatar Mar 08 '20 05:03 musahaidari