Learn how to rename a node after installation #284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The rename_node function is part of node-build that way the build
definitions simply need to define their after_install_package function
to invoke rename_node.
The function accepts a specific name as the new name, but defaults the
name to the actual response from
node --version
.PREFIX_PATH must be updated after the move such that the rest of
node-build knows about the new location.
After moving the installed node, a symlink is created at the original
location pointing to the new location. This allows end users to set
their selected node using the same name as the build definition.
Further, this "hack" allows any other plugins that hook into
after-install to continue operating unchanged. Without the symlink,
PREFIX
andNODENV_VERSION
would be incorrect for all after-installhooks. However, as they now refer to an existing directory (symlink),
the hooks will operate on the newly installed node correctly.
Fixes #237
Unblocks #145
todo