Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nvm-sh/nvm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.40.1
Choose a base ref
...
head repository: nvm-sh/nvm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.40.2
Choose a head ref
Loading
Showing with 1,089 additions and 215 deletions.
  1. +1 −0 .github/ISSUE_TEMPLATE/config.yml
  2. +8 −0 .github/{ISSUE_TEMPLATE.md → ISSUE_TEMPLATE/issue_template.md}
  3. +5 −0 .github/workflows/latest-npm.yml
  4. +2 −0 .github/workflows/release.yml
  5. +4 −3 .github/workflows/tests.yml
  6. +2 −1 .github/workflows/toc.yml
  7. +0 −10 .travis.yml
  8. +8 −0 CONTRIBUTING.md
  9. +11 −7 Dockerfile
  10. +105 −24 README.md
  11. +6 −6 install.sh
  12. +77 −35 nvm.sh
  13. +3 −3 package.json
  14. +1 −0 test/fast/Unit tests/mocks/LTS_names.txt
  15. +1 −1 test/fast/Unit tests/mocks/lts-star.txt
  16. +48 −0 test/fast/Unit tests/mocks/nodejs.org-dist-index.tab
  17. +349 −30 test/fast/Unit tests/mocks/nodejs.org-download-nightly-index.tab
  18. +24 −2 test/fast/Unit tests/mocks/nvm ls-remote lts.txt
  19. +50 −2 test/fast/Unit tests/mocks/nvm ls-remote node.txt
  20. +50 −2 test/fast/Unit tests/mocks/nvm ls-remote.txt
  21. +1 −0 test/fast/Unit tests/mocks/nvm_ls_remote LTS nightly.txt
  22. +24 −2 test/fast/Unit tests/mocks/nvm_ls_remote LTS.txt
  23. +4 −1 test/fast/Unit tests/mocks/nvm_ls_remote nightly.txt
  24. +1 −1 test/fast/Unit tests/mocks/nvm_ls_remote stable nightly.txt
  25. +1 −1 test/fast/Unit tests/mocks/nvm_ls_remote stable.txt
  26. +50 −2 test/fast/Unit tests/mocks/nvm_ls_remote.txt
  27. +4 −3 test/fast/Unit tests/mocks/nvm_make_alias LTS alias calls.txt
  28. +1 −1 test/fast/Unit tests/mocks/nvm_print_implicit_alias remote stable nightly.txt
  29. +1 −1 test/fast/Unit tests/mocks/nvm_print_implicit_alias remote stable.txt
  30. +35 −0 test/fast/Unit tests/nvm install with nonlowercase LTS name
  31. +24 −6 test/fast/Unit tests/nvm ls-remote
  32. +14 −4 test/fast/Unit tests/nvm_alias LTS-N
  33. +33 −23 test/fast/Unit tests/nvm_get_arch
  34. +1 −1 test/fast/Unit tests/nvm_install_no_progress_bar
  35. +23 −7 test/fast/Unit tests/nvm_normalize_lts
  36. +47 −22 test/install_script/nvm_detect_profile
  37. +10 −10 test/installation_node/install LTS
  38. 0 ...ow/nvm exec/{Preamble works and respects 'silent' flag → Running 'nvm exec --silent' should work}
  39. +1 −1 test/slow/nvm reinstall-packages/should work as expected
  40. +12 −3 test/slow/nvm reinstall-packages/works with no installs
  41. +28 −0 test/slow/nvm run/Running 'nvm run --silent' should work
  42. 0 test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely
  43. +19 −0 test/slow/nvm use/Running 'nvm use lts' shows actionable error
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
name: File an issue…
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

<!-- Thank you for being interested in nvm! Please help us by filling out the following form if you‘re having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! -->

5 changes: 5 additions & 0 deletions .github/workflows/latest-npm.yml
Original file line number Diff line number Diff line change
@@ -37,6 +37,11 @@ jobs:
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
include:
- node-version: "21"
- node-version: "20.5"
- node-version: "20.4"
- node-version: "14.17"
- node-version: "14.16"
- node-version: "9.2"
- node-version: "9.1"
- node-version: "9.0"
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@ jobs:
raw.githubusercontent.com:443
registry.npmjs.org:443
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions/setup-node@v4
with:
node-version: "14"
7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: urchin tests

on: [push]
on: [push, pull_request]

permissions:
contents: read
@@ -31,6 +31,8 @@ jobs:
suite:
- install_script
- sourcing
- slow
- installation_iojs
shell:
- sh
- bash
@@ -58,12 +60,11 @@ jobs:
- run: sudo ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}
- run: curl --version
- run: wget --version
- uses: ljharb/actions/node/run@main
- uses: ljharb/actions/node/install@main
name: 'npm install && version checks'
with:
node-version: 'lts/*'
skip-ls-check: true
shell-command: echo installed
- run: npm ls urchin
- run: npx which urchin
- run: env
3 changes: 2 additions & 1 deletion .github/workflows/toc.yml
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ jobs:
allowed-endpoints:
github.com:443
registry.npmjs.org:443
api.github.com:443
- uses: actions/checkout@v4
with:
# https://github.com/actions/checkout/issues/217#issue-599945005
@@ -30,7 +31,7 @@ jobs:
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: 'lts/*'
- run: npm install
- run: npm run doctoc
- name: commit changes
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -87,18 +87,8 @@ env:
- SHELL=bash TEST_SUITE=fast
- SHELL=zsh TEST_SUITE=fast
# - SHELL=ksh TEST_SUITE=fast
- SHELL=sh TEST_SUITE=slow
- SHELL=dash TEST_SUITE=slow
- SHELL=bash TEST_SUITE=slow
- SHELL=zsh TEST_SUITE=slow
# - SHELL=ksh TEST_SUITE=slow
- SHELL=sh TEST_SUITE=installation_iojs
- SHELL=sh TEST_SUITE=installation_iojs WITHOUT_CURL=1
- SHELL=dash TEST_SUITE=installation_iojs
- SHELL=dash TEST_SUITE=installation_iojs WITHOUT_CURL=1
- SHELL=bash TEST_SUITE=installation_iojs
- SHELL=bash TEST_SUITE=installation_iojs WITHOUT_CURL=1
- SHELL=zsh TEST_SUITE=installation_iojs
- SHELL=zsh TEST_SUITE=installation_iojs WITHOUT_CURL=1
# - SHELL=ksh TEST_SUITE=installation_iojs
# - SHELL=ksh TEST_SUITE=installation_iojs WITHOUT_CURL=1
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -113,3 +113,11 @@ Co-authored-by: Name Here <email@here>

# Where can I ask for help?
If you have any questions, please contact [@LJHarb](mailto:ljharb@gmail.com).

# Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:
- The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
- The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
- The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
- I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -91,16 +91,20 @@ RUN echo 'nvm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Switch to user "nvm" from now
USER nvm

# Create a script file sourced by both interactive and non-interactive bash shells
ENV BASH_ENV /home/nvm/.bash_env
RUN touch "$BASH_ENV"
RUN echo '. "$BASH_ENV"' >> "$HOME/.bashrc"

# nvm
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> "$HOME/.bashrc"
RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> "$HOME/.bashrc"
RUN echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> "$HOME/.bashrc"
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> "$BASH_ENV"
RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> "$BASH_ENV"
RUN echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> "$BASH_ENV"

# nodejs and tools
RUN bash -c 'source $HOME/.nvm/nvm.sh && \
nvm install node && \
npm install -g doctoc urchin eclint dockerfile_lint && \
npm install --prefix "$HOME/.nvm/"'
RUN nvm install node
RUN npm install -g doctoc urchin eclint dockerfile_lint
RUN npm install --prefix "$HOME/.nvm/"

# Set WORKDIR to nvm directory
WORKDIR /home/nvm/.nvm
Loading