Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow global installation of NVM with individual user .nvm directories for Node installs #3056

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Mar 10, 2023

  1. Allow nvm-exec to be linked into individual .nvm directories for syst…

    …em-wide installs with a localized Nodes.
    
    Let's say we have nvm installed in a separate mount, /.socket. NVM_DIR is $HOME/.nvm in /etc/profile.d/nvm.sh. With this setup, users can install Node versions to their home directories without each installing nvm.
    
    nvm install --lts
    
    This works fine as does nvm use --lts. When nvm exec is used though, it fails because it looks for nvm-exec in $NVM_DIR. First fix is to look for nvm-exec in $NVM_DIR. If NVM_DIR does not contain nvm-exec, check $BASH_SOURCE[0]. The second fix is to follow nvm-exec if a symbolic link to determine the proper location of nvm's home. Alternatively we could use a second environment variable, NVM_HOME in exec instead of relying on the directory name of nvm-exec.
    msaladna authored and chall8908 committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    d7058a4 View commit details
    Browse the repository at this point in the history
  2. shellcheck warnings

    msaladna authored and chall8908 committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    9dc29fd View commit details
    Browse the repository at this point in the history
  3. Add test for NVM_DIR outside nvm.sh

    msaladna authored and chall8908 committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    c74c74e View commit details
    Browse the repository at this point in the history