Open rmg opened 7 years ago
Sounds reasonable and should be straightforward to implement: somewhere around lib/version.js#L91 you'd need to resolve a partial remoteName
to one of the values from settings.remotes
. Contributions welcome. :)
Should aliases allow partial matches also?
I'm still trying to wrap my head around how aliases work in nvs
. My experience is no doubt being coloured by:
nvm
Aliases seem to match the version instead of the remote..
An alias refers to a combination of a remote name and semantic version. (If a remote name is unspecified, then the default remote is implied.) Or as a special case, an alias may refer instead to a directory containing a node binary.
Current status:
const versionRegex =
/^(([\w\-]+)\/)?((v?(\d+(\.\d+(\.\d+)?)?(-[0-9A-Za-z.]+)?))|([a-z][a-z_\-][0-9a-z_\-]*))(\/((x86)|(32)|((x)?64)|(arm\w*)|(ppc\w*)))?$/i;
😭
RegExp shock aside, #39 is what I eventually settled on as an implementation of this.
Given:
I would expect
nvs use chakra
to matchchakracore-nightly/8.0.0-nightly2017031520fa6b1909/x64
.There appears to already be support for segment matching, so
nvs use chakracore-nightly
andnvs use node
select the obvious nodes.I haven't looked at the code yet to see if this would be ugly to implement or not, just something I found myself wanting while experimenting moving from
nvm
on my Mac.