Manage multiple NodeJS versions.
Handle aliases in lts dir for versions
Update to add support for direct lts aliases
Presence of bin/ subdir determines versionness
Only recurses into lts/ subdir to find versions but now uses the presence of a bin/ subdir to determine if a given directory should be considered a node version and listed.
This covers whether "lts" is itself a direct named version, alias, or namespace for other versions/aliases.
workflow and metadata maintenance
Clarify the description of rbenv versions
Fixes #1148
rbenv 1.1.2
Disallow path segments and directory traversal in .ruby-version
files
A malicious .ruby-version
file in the current directory could inject
../../../
into the version string and trigger execution of binaries
outside of RBENV_ROOT/versions/
.
Fixes #977 OVE-20170303-0004
Make --version more semver friendly
The current output of nodenv --version is essentially the direct output of git-describe, which is TAG-COMMITS_SINCE_TAG-gSHA.
The commits-since, and sha segments would be considered build metadata in semver parlance.
This change tweaks the output of git-describe such that it is in a semver compliant format; despite not strictly being semver compliant in semantics. (Which isn't really possible with edge/HEAD anyway)
It also eliminates the "g" prefix which is used to denote the sha references the git SCM.
rbenv help: fix 'type: write error: Broken pipe'
Sometimes the command fails with a 'type: write error: Broken pipe'. This is because 'head -1' only reads the first line, then exits. If 'type' writes the second line after 'head -1' has already exited, then the aforementioned error is triggered.
We fix this by buffering the entire output of 'type' before invoking 'head -1'.
Silence errors when piping type | head -1
Allow /
in version names
rbenv removed support for directory traversal ..
as well as path
segments. However, nodenv has a valid use-case for path segments: the
lts alias names.
This change keeps the ..
pattern blocked, while allowing forward
slashes in the version name.
see: https://github.com/rbenv/rbenv/issues/977#issuecomment-489762389
nodenv-version learns to describe aliases
When printing the current node version and its origin (how it was set), nodenv-version now resolves any symlinks to determine the final targeted version.
It prints the version name as selected, an arrow and the aliased version name, and finally the origin. If the version is not an alias, the output is the same as before.
This only affects the output of nodenv version
;
nodenv-version-name
and nodenv-version-origin
are unaffected.
Remove test-only abort messages
These messages are only printed if NODENV_NATIVE_EXT is set; and it is only set for test runs. (It is not expected to be set by users.) Thus these messages are only useful when running on travis, and I'd rather there not be test-only code running for users.
Ignore errors if nodenv-prefix fails
nodenv-prefix will print errors to STDERR if node isn't available in PATH. (As demonstrated on Travis, since the nvm's nodes are removed from PATH by the test-helper.)
We don't actually care if node is available in PATH or not for this check, we only care to print the selected node and follow it if it's a symlink. So if nodenv-prefix fails, the path would be empty, thus no need to follow it and we just print the same message as before.
Print versions in semantic order
Take sort_versions function from node-build (which is broken). Use extended regular expression for simplicity Ignore semver-spec characters from sorting. (remove ^, ~, etc) Ensure shorter version names sort first (.0 instead of .z) Ensure node versions sort above others; iojs, chakra, etc (prefix a. if leading digit)
Fix incorrect count of versions in nodenv versions
Fix fish subcommand completion
This allows subcommand style plugins to properly autocomplete. Existing commands are not affected.
Example, say you have support for rbenv foo bar --flag
, then
this allows the last --flag
argument to be properly completed.
Fix pyenv -> rbenv typo
partly resolve #759
Enforce absolute RBENV_DIR
This prevents CDPATH from becoming an issue.
Closes #866.
Don't unset CDPATH
rbenv-version-file: ensure that the version file is a file
Forwarded from https://github.com/pyenv/pyenv/pull/606.
rbenv 1.1.1
Fixed rbenv init -
output to work w/ no args and bash's set -u
.
Quote directory name in variable assignment
Fix some issues reported by shellcheck
Better error message for rbenv shell
Shell integration is not enabled by default. This means that, from all the
commands from rbenv commands
, only "shell" won't work right away.
Replace "no such command" with a more descriptive message that points to
rbenv init
instead.
Fix https://github.com/rbenv/rbenv/issues/1065
Command rbenv version-name > .ruby-version
will create an empty .ruby-version
file
before running rbenv-version-file
. This causes rbenv-version-file
to return empty
string which in turn causes rbenv-version-name
to return system
.
Ensure size of .ruby-version
is non-zero as a workaround.
Remove ableist language
rbenv-which: change PATH only for the "command -v" lookup
This is not really necessary, because rbenv-which is used in a subshell currently, but makes a difference if rbenv-which would be sourced.
rbenv-prefix: do not silence rbenv-which for system version
This suppressed any output when using RBENV_DEBUG=1 and does not really hurt to have in the unlikely case that it should fail; you would get two error messages now:
rbenv: ruby: command not found rbenv: system version not found in PATH
Hard-code package version into nodenv
This helps with portability and eliminates the dependency on package.json file living with the deployed app.
fixes #70
streamline nodenv---version