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

[spam] #2735

Closed
wants to merge 1,462 commits into from
Closed

[spam] #2735

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
1462 commits
Select commit Hold shift + click to select a range
59b0b39
[readme] Add quick intro to `nvm`
alnorris Dec 6, 2016
1afd4f3
[Tests] Add `markdown-link-check` script
PeterDaveHello Nov 4, 2017
7b530ed
[Docs] Use absolute URL for #606 in README.md
PeterDaveHello Nov 4, 2017
7bbc573
[Tests] Print shell version in Travis CI
PeterDaveHello Apr 1, 2017
7b0a46e
[docker] add libssl-dev to Docker image
sturman Jun 18, 2018
82037b4
[Docs] clean up a bit
kant Oct 6, 2017
dcbecbf
[shellcheck] install shellcheck v0.6.0 in Dockerfile
sturman Jun 14, 2018
1f7f0c2
[Docs] add version number to `nvm —help` output
JARVIS-AI Jan 27, 2019
2a5d2c0
[Tests] add more checks to make_fake_* helpers
ljharb Feb 23, 2019
58d0933
[Fix] attempt to fix a bug in bash 3.2, fixed in 4.4, that improperly…
ljharb Feb 24, 2019
04fdb23
[Tests] `nvm ls`: ensure `nvm alias` is called
ljharb Feb 24, 2019
c6740f5
[New] `nvm ls`: add `--no-alias` to suppress alias output
ljharb Feb 24, 2019
41eb408
[Docs] add “update” terminology to installation section
JARVIS-AI Jan 25, 2019
4c8ced7
[Docs] `nvm --help`: add `--no-colors` and `--no-alias`
ljharb Feb 24, 2019
930507d
[Docs] README.md: mention --no-colors option
jcsahnwaldt Feb 23, 2019
216c24f
[Docs] `--help`: consolidate some help output
ljharb Feb 25, 2019
1ede50c
[Docs] Add note about what version of node new shells run with.
ericandrewlewis Feb 22, 2019
226487d
[Fix] `install`: error out when an argument has `---`
ljharb Feb 25, 2019
e0d8752
[shellcheck] remove unnecessary overrides
ljharb Feb 25, 2019
9daf26f
[Tests] `nvm_command_info`: make error output more helpful
ljharb Feb 25, 2019
924a175
[Tests] update dist from trusty to xenial
refack Feb 25, 2019
43402df
[Fix] `nvm_supports_source_options`: work around a bug in bash 3.2
ljharb Feb 27, 2019
a1abfd1
[Tests] use rimraf over `rmdir` in teardowns
jcsahnwaldt Feb 27, 2019
2410215
[Refactor] add `nvm_stdout_is_terminal` helper
jcsahnwaldt Feb 23, 2019
ff77ac1
[Docs] update `bash` `cdnvm` script to properly handle aliases
d4nyll Mar 12, 2019
970cadf
[Docs] Add `--latest-npm` info to Migrating global packages section
metasean Dec 31, 2018
e7a5b79
[meta] update repo links to point to org
ljharb Apr 24, 2019
45c1b84
[Fix] Determine correct sub directory if XDG_CONFIG_HOME is set
bastiaf Apr 28, 2019
d48abff
[Docs] clean up formatting in readme
kant May 3, 2019
ee9e565
[Tests] `jspm` v2 beta started breaking tests; pin to < v2
ljharb May 4, 2019
3664744
Updated note about Windows
alfredmyers May 2, 2019
0b5bb5c
[Fix] `set -u`: Add default empty value for `$NVM_NO_ALIAS`
sehrope May 14, 2019
07b20d5
[meta] add copyright line to license file
ljharb Jul 17, 2019
6537c91
Fix bash auto-use nvm command
smithgp Aug 9, 2019
3cc9525
[Docs] [Fix] Set $NVM_DIR to ".nvm" instead of "nvm"
WillPapper Apr 24, 2019
011810e
v0.35.0
ljharb Oct 2, 2019
94a72ae
[Fix] `nvm use`: improve help output with bare `nvm use` and no `.nvmrc`
ljharb Oct 8, 2019
0a4e6f2
[meta] Update ISSUE_TEMPLATE.md
guidobouman Oct 8, 2019
1eca354
[Docs] Add description if instructions don't work; make install instr…
maritiren Oct 20, 2019
100861d
[Fix] `install-latest-npm`: `npm` `v6.10` breaks on `node` `v6.0`, `v…
ljharb Nov 3, 2019
28bc2fd
v0.35.1
ljharb Nov 3, 2019
1c8e591
[meta] create FUNDING.yml
ljharb Nov 5, 2019
04ad1b5
[readme] Fix a typo
awthwathje Nov 8, 2019
73a513c
[Fix] allow `nvm unalias x` when `x` is a default alias, but shadowed
ljharb Nov 12, 2019
d8785da
[Docs] Improve readme clarity and troubleshooting
nebbles Nov 17, 2019
0899839
[Tests] pin `david` to v11
ljharb Dec 9, 2019
6fa92c8
[Fix] if a prefix env var is set (as in npm run), but is correct, do …
ljharb Dec 16, 2019
f355b32
v0.35.2
ljharb Dec 18, 2019
4ff9084
[Docs] Fix small typo in README
LucianBuzzo Dec 5, 2019
a1ad32e
[readme] restore broken anchor
ljharb Jan 12, 2020
f4eddb2
[Tests] ensure `nvm unload` unsets env vars too
ljharb Feb 7, 2020
6c560b1
[New] `use`: set `NVM_INC` to expose the node include path
bmacnaughton Feb 7, 2020
4cd6b48
[Tests] try to make `nvm unload` test more robust
ljharb Feb 9, 2020
8093dbe
[readme] add nvm intro
flip111 Jan 23, 2020
e609091
[Tests] update test mocks
ljharb Feb 22, 2020
b953632
[Fix] `nvm ls-remote`: properly label latest LTS versions instead of …
ljharb Feb 22, 2020
30cd9c5
[Tests] fix update mocks script
ljharb Mar 4, 2020
c372ff0
[Tests] update mocks
ljharb Mar 4, 2020
4626d1a
[New] add `lts/-1` etc, to point to an LTS line relative to "latest"
ljharb Mar 4, 2020
096ba0d
`uninstall`: add `NVM_DEBUG` to print out a filename as its permissio…
ljharb Mar 6, 2020
258938e
v0.35.3
ljharb Mar 6, 2020
f607f2f
[Fix] `reinstall-packages`: do not include unmet peer deps
ljharb Mar 11, 2020
b026170
[Tests] Source nvm.sh before defining FILE
memark Mar 19, 2020
73438e3
Update Dockerfile base image to Ubuntu 16.04, cc #2008
PeterDaveHello Mar 29, 2020
e0ed1ea
[meta] add actions: Automatic Rebase for PRs, auto-update-TOC for push
ljharb Apr 29, 2020
8e1e5df
[meta] fix TOC action
ljharb Apr 29, 2020
dcc8059
[readme] include deeper integration instructions for fish
Apr 29, 2020
7aba64a
[meta] further TOC action tweaks
ljharb Apr 30, 2020
91a55dd
[Refactor] Rename solaris and iojs helper functions to be nvm_ prefixed
sehrope May 8, 2020
33fa27d
[Docs] Update README for environment variables
bmacnaughton Feb 7, 2020
7b3af45
[readme] Update install instructions troubleshooting
connor11528 May 25, 2020
6575b6b
[Fix] `install`: improved arg parsing around `--reinstall-packages-from`
ljharb Jun 4, 2020
2d4e877
[readme] Stop removing spaces from nvm_path
stopsopa Jun 10, 2020
bac5393
[Docs] Syntax highlight for Ansible task example in README.md
PeterDaveHello May 29, 2020
06c3bf6
[Docs] `--help`: explain more clearly that <version> parameter is opt…
ritmos Jun 20, 2020
d2d232e
[readme] Update macOS troubleshooting w/ 10.15 zsh default
mkaz Jun 24, 2020
f6d11ba
[readme] Fix fish load_nvm function
megawubs Jul 7, 2020
4b1100e
[New] `nvm_supports_xz`: Add Mac/FreeBSD xz platform support checks
DeeDeeG Jan 29, 2020
55eafcd
[New] add `nvm -v` as an alias for `nvm --version`
Jul 27, 2020
83043c4
[debug] add `whoami` output
ljharb Jul 25, 2020
a5aec10
[New] adding default and alias option to `nvm install`
kaltepeter Oct 22, 2018
3561bbc
[Fix] `--help`: Add more examples
naomiquinones Jul 29, 2020
abfe0a5
[Refactor] remove unused `nvm_checksum` function
ljharb Aug 1, 2020
424aeb3
[Refactor] add `nvm_get_checksum_binary`; use it in `nvm debug`
ljharb Aug 1, 2020
18c6f98
[readme] Add documentation for LTS updates which reinstall existing p…
saikatdas0790 Jul 28, 2020
a01deb1
[patch] Update docs and add warning for 'nvm is not compatible with t…
mkarajohn Jul 20, 2020
1bf567b
[Fix] ensure `--help` is intercepted on any command
naomiquinones Aug 4, 2020
16b75b7
[Robustness] add `command` to `xargs`/`rm` in `nvm_get_default_packages`
ljharb Aug 11, 2020
b1200c6
[Fix] `nvm use`: fix `--silent` when version is omitted
Yash-Singh1 Aug 9, 2020
1c00753
[New] `nvm deactivate`/`nvm which`: add `--silent`
ljharb Aug 13, 2020
9dc6f3e
[Refactor] `nvm run`/`nvm exec`: use `NVM_SILENT` consistently intern…
ljharb Aug 13, 2020
19c55b9
[readme] Mention problem with windows cmd echo
SteveALee Aug 11, 2020
f7fbad2
[performance] `nvm_auto`: only call `nvm_ls_current` in `use` mode
michaelPotter Aug 19, 2020
cf92956
[New] add `nvm_find_project_dir` helper
ljharb Aug 23, 2020
035bf9e
[readme] update autocompletion output examples
ljharb Aug 24, 2020
1d88ecf
[Fix] `nvm_die_on_prefix`: check that the prefix is inside the versio…
ljharb Aug 24, 2020
22e07cc
[readme] fix LTS upgrade command
saikatdas0790 Aug 27, 2020
68d331a
[dockerfile] Remove ShellCheck Segmentation fault workaround
PeterDaveHello Sep 20, 2020
6110d31
[dockerfile] Add missing apt pacakge `locales`
PeterDaveHello Sep 21, 2020
6e0562a
[Tests] pin postcss to v7
ljharb Sep 21, 2020
68d2f47
[dockerfile] Update ShellCheck download URL in Dockerfile
PeterDaveHello Sep 21, 2020
c7ca08d
[Fix] `latest-npm`: ensure npm 7 is not installed on node < 10
ljharb Sep 23, 2020
8debf39
v0.36.0
ljharb Sep 23, 2020
7929190
[Docs] improve `nvm --help` output
ljharb Oct 3, 2020
344cc32
[readme] bash shell integration: Amended example to call cd when boot…
matthieubosquet Oct 5, 2020
4436638
[Tests] Drop deprecated `sudo:` option in TravisCI config
PeterDaveHello Sep 21, 2020
96069da
[Fix] `nvm_ls`: zsh: unset `markdirs` and `local_options`
dylanarmstrong Oct 9, 2020
e01060f
[Fix] `nvm_die_on_prefix`: use directory comparison rather than string
dylanarmstrong Oct 9, 2020
e77ed07
[Tests] Fix `nvm_ls_current` fast test
reasonablytall Oct 13, 2020
0f0d5e8
[dev deps] alphabetize dependencies
ljharb Oct 23, 2020
f2c5ce4
[Tests] Fix nvm unload fast test cleanup
reasonablytall Oct 22, 2020
c72f2c6
[Fix] `nvm ls-remote`: accept versions that end with a dot
gitburd Sep 24, 2020
31bc0a1
[Dockerfile] Clean up dated comment
PeterDaveHello Nov 3, 2020
499d303
[Perf] `use`/`nvm_die_on_prefix`: replicate npm config algorithm and …
ljharb Aug 25, 2020
4054bd7
v0.37.0
ljharb Nov 6, 2020
bbe032f
[actions] switch Automatic Rebase workflow to `pull_request_target` e…
ljharb Nov 7, 2020
11a9d22
[actions] add "Allow Edits" workflow
ljharb Nov 7, 2020
00af634
[Tests] Run fast test suite in clean environment
reasonablytall Nov 4, 2020
21c0c05
[Fix] `nvm_die_on_prefix`: only grep lines starting with env var name
Nov 16, 2020
3abb981
[actions] Add shellcheck workflow
reasonablytall Nov 18, 2020
6848c16
[New] Added `set-colors` command. See details below:
gitburd Aug 17, 2020
22902f0
[actions] Add release test workflow
reasonablytall Nov 20, 2020
80a4e06
[Tests] partially migrate to Github Actions
ljharb Nov 7, 2020
510b2fd
[Tests] fix eclint errors
ljharb Nov 22, 2020
661a702
v0.37.1
ljharb Nov 25, 2020
3b57dfe
Revert "[Fix] `nvm_die_on_prefix`: only grep lines starting with env …
ljharb Nov 28, 2020
4b947ec
v0.37.2
ljharb Nov 28, 2020
ed321f1
[Tests] `release`: clobber local tags
ljharb Nov 28, 2020
d4eba35
[Fix] `install`: Ignore npm command under $NVM_DIR when checking for …
dmolesUC Nov 17, 2020
8670883
[Fix] Use local variable when looping over args
klazuka Dec 8, 2020
e48cb85
[Tests] `.npm` is now cached by default
chenrui333 Oct 2, 2019
e76b294
[Fix] relax `$PREFIX` checking, to accomodate `npm exec`
ljharb Dec 22, 2020
3c079f1
[shellcheck] fix silly shellcheck complaint
ljharb Dec 22, 2020
10399ed
[Docs] source `./nvm.sh` instead of `nvm.sh`, for `zsh`
huahuayu Apr 27, 2020
6982dee
[Docs]: Updated README.md to include homebrew unsecure dirs warning
hjoshi123 Dec 22, 2020
1081ed1
[New] `install`: add parallel build support for openbsd
Nabstar Dec 26, 2020
f3fa157
[Fix] `bash_completion`: move compinit before bashcompinit
hjoshi123 Dec 29, 2020
4e9df33
[New] install script: Allow installation from other repository
nmarghetti Dec 27, 2020
7f6c0c0
[Refactor] add `nvm_install_binary_extract`
nmarghetti Jan 1, 2021
9849bf4
[meta] Rename some files to be more cross platform
nmarghetti Jan 3, 2021
d396181
[Refactor] add `nvm_get_artifact_compression`
nmarghetti Jan 1, 2021
436cda2
[Fix] remove `nvm_supports_source_options`
ljharb Jan 7, 2021
9f3397a
[Tests] add `nvm_grep` to install script, fix tests
nmarghetti Jan 8, 2021
60e78d3
[Tests] Add unit test for nvm_download
nmarghetti Jan 13, 2021
589c237
[Fix] install script: sync `nvm_download` implementation from nvm.sh
nmarghetti Jan 13, 2021
502089a
[New] install script: Allow installation from other repository also f…
nmarghetti Jan 7, 2021
2fea55f
[Tests] add test that fails without fix for #2362
gitburd Jan 15, 2021
31c5c5c
[Fix] avoid parse error with common omz global aliases, in `nvm_print…
hosamaly Nov 27, 2020
015623e
[Fix] avoid parse error with common omz global aliases, in `nvm_print…
ljharb Jan 20, 2021
3243f7a
[Fix] Fix potential unbound var error on nvm install
blr246 Jan 27, 2021
49e806c
[readme] Add macOS troubleshooting instructions for M1 chip
mcalthrop Jan 21, 2021
4c11ab1
[actions] update workflows
ljharb Feb 1, 2021
0d14d7f
[Dev Deps] update `doctoc`, `replace`, `semver`
ljharb Feb 1, 2021
0fad5ec
[readme] quote asterisk in shell command on `--latest-npm` example
itizarsa Feb 5, 2021
d5c1441
[readme] Update M1 macOS troubleshooting instructions
zulaica Feb 13, 2021
a5742d4
[readme] add install error tips
shiyutim Jan 7, 2021
87f3790
[meta] add CODE_OF_CONDUCT.md
ljharb Feb 15, 2021
52f67b3
[Fix] `exec`: `--` should stop argument parsing
vvilhonen Nov 20, 2020
d9b11ba
[readme] update `cdnvm` implementation
Feb 19, 2021
4fdef42
[New] `install`: add `-b` flag to skip building from source
Feb 16, 2021
f258227
[New] maybe support Windows with WSL, MSYS, Cygwin
nmarghetti Jan 1, 2021
8884fd3
[readme] Add `nvs` as one of the Windows alternatives
goostleek Mar 1, 2021
641f868
[Tests] update mocks
ljharb Mar 11, 2021
4da7f10
[Fix] `nvm_alias`: ensure `lts/-1` returns the one before `lts/*`
RodEsp Mar 11, 2021
216ccd6
[readme] add commands to help troubleshoot without closing the curren…
artforlife Apr 26, 2020
9cb6a2b
[Tests] ensure `doctoc` action fails when it should
ljharb Mar 17, 2021
25d2ebf
[readme] add headings to certain sections
Mar 3, 2021
0579718
[Fix] install script: define `nvm_echo`
ljharb Mar 17, 2021
b19d8db
[readme] Update source command to include s in zsh
Mar 18, 2021
621ccc5
Clarify the M1 shell instructions
jonathanperret Mar 23, 2021
c26bd93
[readme] M1 macs: Add `nvm use` command to clarify that it is required
jonathanperret Mar 24, 2021
cfc7eda
[Dev Deps] update `dockerfile_lint`, `eclint`, `replace`, `semver`
ljharb Mar 29, 2021
3fea549
v0.38.0
ljharb Mar 29, 2021
779a34e
[Fix] `nvm_get_arch`: Rasbperry Pi: armv7l with arm64 kernel, get cor…
Botspot Mar 22, 2021
5fcec57
[readme] Improve README about Macs with M1 chips
leafac Apr 5, 2021
d118be8
[Tests] Add unit tests for `nvm_is_version_installed`
nmarghetti Feb 21, 2021
f534fde
[Tests] `node-gyp` v8 breaks this test
ljharb Apr 6, 2021
2b5e53f
[Fix] install script: check the proper version; fetch tags also
Apr 1, 2021
07253ec
[actions] adjust shellcheck/windows tests to9 have a final "done" job
ljharb Apr 16, 2021
117486d
[Fix] `bash_completion`: check if `compinit` is called before calling it
akefirad Apr 16, 2021
bd0ac1e
[meta] add `SECURITY.md`
ljharb Apr 23, 2021
1527ac9
[readme] remove redundant "license" section text in favor of LICENSE.md
ljharb Apr 26, 2021
f3caa06
[meta] add OpenJS Foundation copyright notices/links
ljharb Apr 26, 2021
fc87226
[readme] move License and Copyright notice sections to the bottom
ljharb Apr 26, 2021
b5165ec
[shellcheck] update for new warnings in v0.7.2
ljharb May 3, 2021
ad24e96
[shellcheck] disable additional `-x` warning from v0.7.2
ljharb May 3, 2021
eed0d0e
[meta] add project charter and governance
ljharb Apr 26, 2021
055af09
[readme] link "Windows WSL" down to the "important notes" section
SimonEast May 4, 2021
47f0b32
[readme] Add info to restart bash if verification not working in veri…
asab-se Feb 25, 2018
7ba49f8
[actions] use `node/install` instead of `node/run`
ljharb Jul 28, 2021
7f2ccd5
[Fix] `nvm_get_arch`: suppress error output if `/sbin` does not exist
ljharb Aug 5, 2021
812d6e4
[actions] fix typo in dockerfile_lint job
ljharb Aug 5, 2021
e98e9d9
[Fix] `install`: Detect correct profile based on $SHELL var
tg90nor Aug 12, 2021
e0df5e9
[Robustness] avoid IFS shenanigans: quote arg count/return codes
ljharb Aug 24, 2021
62d45af
[readme] fix typo regarding docker image base in Dockerfile
Aug 30, 2021
678a827
[Dockerfile] Update dated base image from Ubuntu 16.04 to 18.04
PeterDaveHello Aug 25, 2021
fd78c01
[Tests] disable `fail-fast`
ljharb Aug 31, 2021
5b77f7d
[Fix] `nvm ls`/`nvm alias`/`nvm_list_aliases`: zsh: when no LTS alias…
ljharb Sep 1, 2021
c169d62
[Tests] update mocks
ljharb Sep 4, 2021
291c7c4
[Fix] `nvm_ls_remote_index_tab`: handle long version lists
kstolp Sep 4, 2021
2dad045
[Fix] `nvm_die_on_prefix`: avoid grepping env functions in bash
ljharb Sep 9, 2021
fa63399
[Tests] `postcss` v7.0.36 stopped working on node 0.10; downgrade to v4
ljharb Sep 9, 2021
f03f695
[Fix] `reinstall-packages`: handle global symlink locations properly
ljharb Sep 7, 2021
59532c7
[actions] restrict permissions for `GITHUB_TOKEN`
step-security-bot Sep 10, 2021
d91087c
[Fix] `bash_completion`: be robust when `cd` is overridden
giladbarneaallot Sep 13, 2021
b6b6e68
[Fix] `set -a`: when this option is set, some `sh` shells break
ljharb Sep 15, 2021
cc6915e
[readme] updated automatic call script for bash
donnikitos Sep 21, 2021
91bd22a
[readme] fixed small typo afew to a few
strouja Jun 4, 2021
ca897ac
[readme] Avoid infinite loop in cdnvm()
tim-connolly Sep 22, 2021
4471b6b
[readme] remove duplicate word 'run'
GeorgiChochov Sep 26, 2021
11d71ab
[Fix] Regression in 2dad045
svenssonaxel Sep 23, 2021
07c02d4
[Tests] `nvm install-latest-npm`: node < 0.10 breaks with npm with dr…
ljharb Sep 29, 2021
53f9ba8
[Refactor] Use awk for path stripping
umireon Dec 22, 2016
93e0070
[Fix] `nvm_die_on_prefix`: filter prefixed env vars on name only, ign…
Nov 28, 2020
da5baa0
[Tests] use a matrix on the `nvm install-latest-npm` tests
ljharb Oct 5, 2021
10189bf
[readme] Add bash_completion in "manual install" section
felipear89 Oct 5, 2021
2bda9fd
[Tests] blacklist expired LetsEncrypt CA
Oct 6, 2021
ebbd30e
[Fix] `nvm install-latest-npm`: ensure npm 8 does not install on unsu…
ljharb Oct 5, 2021
e8f485b
[Dev Deps] update `doctoc`, `markdown-link-check`
ljharb Oct 7, 2021
5b3d188
v0.39.0
ljharb Oct 7, 2021
a284af9
[New] Add OpenBSD support
Apr 15, 2016
c9e7bb2
[Fix] install script: Add `--no-pager` option to git branch
nix6839 Oct 23, 2021
2f40eee
[shellcheck] apply v0.8.0 updates
ljharb Nov 19, 2021
ccd98f7
[Dev Deps] update `doctoc`
ljharb Nov 19, 2021
e9b2693
[readme] Describe another failure case for installing node versions f…
igrayson Nov 15, 2021
30486b9
[readme] Balance the if statement in bash example
Mahoney Nov 22, 2021
8937917
[Fix] `install`: properly check for curl/wget
ljharb Nov 25, 2021
275001b
[Tests] fix windows WSL tests
ljharb Nov 26, 2021
4856407
[Fix] `install`: fix method=script install condition
Meroje Nov 30, 2021
328dd50
[Fix] `nvm_get_download_slug`: better architecture selection for M1 Macs
imaddi47 Nov 21, 2021
81fc056
[Tests] `nvm_get_download_slug`: add unit tests
ljharb Dec 3, 2021
6cc90a4
[actions] add step security runner
varunsh-coder Nov 22, 2021
fb4538b
[Fix] add missing `local` (handle nonexisting /sbin/init a bit more c…
Nov 17, 2021
0b4cd8d
[Refactor] create `nvm_normalize_lts` helper
ljharb Dec 17, 2021
aed1d73
[Fix] `ls-remote`/`install`: properly handle `lts/x` patterns
ljharb Dec 17, 2021
c4c7690
[Fix] `ls-remote`/`install`: support `lts/-X` patterns in installs
ljharb Dec 17, 2021
2459d17
[Tests] update test mocks
ljharb Dec 17, 2021
430860a
[Fix] `nvm alias`/`nvm_list_aliases`: support `lts/` aliases
ljharb Dec 16, 2021
0f62be6
[Dev Deps] update `markdown-link-check`
ljharb Dec 17, 2021
aa57406
[Fix] ensure `unload` removes `nvm_normalize_lts`
ljharb Dec 17, 2021
5cc74a6
[Tests] fix failing test
ljharb Dec 17, 2021
9600617
v0.39.1
ljharb Dec 17, 2021
ccd442d
[Refactor] add `nvm_extract_tarball` to consolidate extraction logic
opsbob Dec 19, 2021
79ad72d
[Fix] Update `nvm_extract_tarball` to support OpenBSD
opsbob Dec 19, 2021
d004c6b
[readme] clarify instructions for running Node on M1 Mac
lukelafountaine Dec 3, 2021
6cfaede
[Fix] `install`: better error message when xcode command line tools a…
ljharb Nov 28, 2021
81f0f3e
[Fix] `set -E`: Add test for `node install` on Bash with an ERR trap …
lkrms Dec 27, 2021
1875fe8
[Fix] avoid OpenBSD `nvm install` error when /sbin/init doesn't exist
lkrms Dec 26, 2021
c2f740a
[patch] HTTP -> HTTPS
ljharb Jan 18, 2022
2c0c34f
[Docs] HTTP => HTTPS
Schweinepriester Jan 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Refactor] add nvm_extract_tarball to consolidate extraction logic
  • Loading branch information
opsbob authored and ljharb committed Dec 19, 2021
commit ccd442d833578bda782c9cf7d5f284b0c5ed703b
64 changes: 37 additions & 27 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1971,19 +1971,7 @@ nvm_install_binary_extract() {
command unzip -q "${TARBALL}" -d "${TMPDIR}" || return 1
# For non Windows system (including WSL running on Windows)
else
local tar_compression_flag
tar_compression_flag='z'
if nvm_supports_xz "${VERSION}"; then
tar_compression_flag='J'
fi

local tar
if [ "${NVM_OS}" = 'aix' ]; then
tar='gtar'
else
tar='tar'
fi
command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 || return 1
nvm_extract_tarball "${NVM_OS}" "${VERSION}" "${TARBALL}" "${TMPDIR}"
fi

command mkdir -p "${VERSION_PATH}" || return 1
Expand Down Expand Up @@ -2251,6 +2239,40 @@ nvm_download_artifact() {
nvm_echo "${TARBALL}"
}

# args: nvm_os, version, tarball, tmpdir
nvm_extract_tarball() {
if [ "$#" -ne 4 ]; then
nvm_err 'nvm_extract_tarball requires exactly 4 arguments'
return 5
fi

local NVM_OS
NVM_OS="${1-}"

local VERSION
VERSION="${2-}"

local TARBALL
TARBALL="${3-}"

local TMPDIR
TMPDIR="${4-}"

local tar_compression_flag
tar_compression_flag='z'
if nvm_supports_xz "${VERSION}"; then
tar_compression_flag='J'
fi

local tar
tar='tar'
if [ "${NVM_OS}" = 'aix' ]; then
tar='gtar'
fi

command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 || return 1
}

nvm_get_make_jobs() {
if nvm_is_natural_num "${1-}"; then
NVM_MAKE_JOBS="$1"
Expand Down Expand Up @@ -2362,18 +2384,6 @@ nvm_install_source() {
fi
fi

local tar_compression_flag
tar_compression_flag='z'
if nvm_supports_xz "${VERSION}"; then
tar_compression_flag='J'
fi

local tar
tar='tar'
if [ "${NVM_OS}" = 'aix' ]; then
tar='gtar'
fi

local TARBALL
local TMPDIR
local VERSION_PATH
Expand All @@ -2393,7 +2403,7 @@ nvm_install_source() {
if ! (
# shellcheck disable=SC2086
command mkdir -p "${TMPDIR}" && \
command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 && \
nvm_extract_tarball "${NVM_OS}" "${VERSION}" "${TARBALL}" "${TMPDIR}" && \
VERSION_PATH="$(nvm_version_path "${PREFIXED_VERSION}")" && \
nvm_cd "${TMPDIR}" && \
nvm_echo '$>'./configure --prefix="${VERSION_PATH}" $ADDITIONAL_PARAMETERS'<' && \
Expand Down Expand Up @@ -4151,7 +4161,7 @@ nvm() {
nvm_npmrc_bad_news_bears \
nvm_get_colors nvm_set_colors nvm_print_color_code nvm_format_help_message_colors \
nvm_echo_with_colors nvm_err_with_colors \
nvm_get_artifact_compression nvm_install_binary_extract \
nvm_get_artifact_compression nvm_install_binary_extract nvm_extract_tarball \
>/dev/null 2>&1
unset NVM_RC_VERSION NVM_NODEJS_ORG_MIRROR NVM_IOJS_ORG_MIRROR NVM_DIR \
NVM_CD_FLAGS NVM_BIN NVM_INC NVM_MAKE_JOBS \
Expand Down
12 changes: 12 additions & 0 deletions test/fast/Unit tests/nvm_extract_tarball
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

die () { echo "$@" ; exit 1; }

\. ../../../nvm.sh

[ "$(nvm_extract_tarball 2>&1)" = "nvm_extract_tarball requires exactly 4 arguments" ] || die 'incorrect error message with no args'
[ "$(nvm_extract_tarball > /dev/null 2>&1 ; echo $?)" = "5" ] || die 'incorrect error code with no args'
[ "$(nvm_extract_tarball one two three 2>&1)" = "nvm_extract_tarball requires exactly 4 arguments" ] || die 'incorrect error message with three args'
[ "$(nvm_extract_tarball one two three > /dev/null 2>&1 ; echo $?)" = "5" ] || die 'incorrect error code with three args'
[ "$(nvm_extract_tarball one two three four five 2>&1)" = "nvm_extract_tarball requires exactly 4 arguments" ] || die 'incorrect error message with five args'
[ "$(nvm_extract_tarball one two three four five > /dev/null 2>&1 ; echo $?)" = "5" ] || die 'incorrect error code with five args'