3 ms·
For a while I had a wrapper script around nvm (that I called "nvm-shell") that let me swap in a shell that was aware of nvm: exec $BASH --init-file <(echo '.
by andrewla 5y ago
For a while I had a wrapper script around nvm (that I called "nvm-shell") that let me swap in a shell that was aware of nvm:
exec $BASH --init-file <(echo '. ~/.bashrc; . $NVM_DIR/nvm.sh; PS1="<nvm>$PS1"')
This worked for me, but it's so ugly. When I found nave I switched over. I do wish bash had some sort of functionality for "after you do the standard initialization, run this script and then be interactive after that". This was the best I could do on that front. I suppose it might be worth having a more generic tool -- "launch_interactive_shell_session_after_executing_script" that could be reused here.
The fact that nave is done entirely in shell script is admittedly a bit terrifying.
Really the best option is just to use nix (and thus nix-shell) for this, but I work in some environments where nix is not yet an option.