Commit Graph
10 Commits
Author SHA1 Message Date
Jordan Harbandanddajiaohuang dbda4b9387 [Fix] install.sh: update from nvm's remote; nvm_ls: list versions without globs; nvm_ensure_version_installed: do not leak VERSION
`install.sh`: an existing install now fetches from the remote whose URL is nvm's source,
adding one when none matches,
instead of always fetching `origin`;
fresh installs still name it `origin`.
The remote's URL is read with `git config`,
since `git remote get-url` needs git 2.7.

`nvm_ls`: `find` lists each version directory's non-hidden subdirectories itself,
so it works under `set -f`,
which disables the globs it was given;
the directories only need to exist.

`nvm_ensure_version_installed`:
the resolved alias was assigned to `VERSION` without declaring it local.

Co-authored-by: dajiaohuang <mikewushuwen@outlook.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2026-11-19 22:51:28 -08:00
Jordan Harband c451e7a4c8 [Tests] set $_ before sourcing nvm.sh in fast tests
nvm.sh uses `NVM_SCRIPT_SOURCE="$_"` to detect its source location.
Adding `: nvm.sh` before each source line ensures `$_` is set correctly, preventing breakage when the previous command (e.g., `set -ex`) overwrites it.
2026-01-26 21:41:57 -08:00
deepakchethan 9e884b8d7b [Fix] nvm install: show proper version in .nvmrc install instructions 2022-03-22 18:58:18 +05:30
Joshua Li a5f42d9cea [Tests] update most mkdirs to use make_fake_{node,iojs} 2018-06-13 10:38:19 -07:00
Jordan Harband 4249b1c2bb [Fix] nvm_ensure_version_installed: add system support.
Relates to #1238
2017-03-31 00:52:56 -07:00
Peter Dave Hello f7763c8ba9 [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
Qiangjun Ran cadbbced20 [Tests] Replace all dots with backslash dots 2016-11-03 23:44:59 -07:00
Quildreen Motta 730b253174 Updates tests for the new output messages 2016-07-05 21:40:45 -03:00
Jordan Harband e3528b0d9e Fix nvm_ensure_version_installed iojs to not print an empty string for the version. 2015-09-11 10:42:47 +09:00
Jordan Harband 0d9329435c Create nvm_ensure_version_installed 2015-02-22 02:26:27 -08:00