You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was a rather difficult one to track down: some distributions have a special clause in their ~/.bashrc that looks something like this (taken from this gist):
# ~/.bashrc: executed by bash(1) for non-login shells.# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)# for examples# If not running interactively, don't do anythingcase$-in*i*) ;;
*) return;;
esac# rest of file with some modifications to $PATH ...
This answer on ServerFault explains in detail why that is, and from the looks of it, for the sake of backwards-compatibility, it isn't going to go away very soon. In my case, it means that the command nvm could not be found, even though my .bashrc was set up correctly.
I propose a small change to the documentation to notify people who are having trouble with this. You can do the following and get it working completely:
# ~/.bashrc: executed by bash(1) for non-login shells.# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)# for examples# If not running interactively, don't do anything# Adds a special case for when we really do want to modify $PATHcase$-in*i*) ;;
*) [ -z"$FORCE_LOGIN" ] &&return;;
esac
Next, wrap the command you would like to run in a function, like so:
function nvm
beginset-lx FORCE_LOAD 1
fenv nvm $argvendend
Hmm seems that I was too quick ... nvm does not modify my $PATH variable and can't find node while it works in plain bash. Maybe it is too good to be true after all ...
This was a rather difficult one to track down: some distributions have a special clause in their
~/.bashrc
that looks something like this (taken from this gist):This answer on ServerFault explains in detail why that is, and from the looks of it, for the sake of backwards-compatibility, it isn't going to go away very soon. In my case, it means that the command
nvm
could not be found, even though my.bashrc
was set up correctly.I propose a small change to the documentation to notify people who are having trouble with this. You can do the following and get it working completely:
Next, wrap the command you would like to run in a function, like so:
Until fish functions are able to accept environment variables, I'm afraid that's the best I can come up with.
The text was updated successfully, but these errors were encountered: