boxen / puppet-nodejs

MIT License
15 stars 47 forks source link

Use nodenv version-name in shell helper function #61

Closed eugeneius closed 8 years ago

eugeneius commented 8 years ago

nodenv version includes a description of how the version was selected:

$ nodenv version
5.0.0 (set by /opt/boxen/nodenv/version)

nodenv version-name prints the version number on its own:

$ nodenv version-name
5.0.0

Since the current_node function is intended to be used "in shell prompts and the like", the second shorter form is more appropriate.

This reverts the change from #56, which had the description:

nodenv version-name isn't a function

It is, though; defined here: https://github.com/OiNutter/nodenv/blob/master/libexec/nodenv-version-name

I suspect @DanielWright was stuck using wfarr/nodenv, which doesn't provide nodenv version-name: https://github.com/wfarr/nodenv/tree/master/libexec

...and I suspect that happened because of a bug in boxen/puppet-repository, which meant refs weren't updated when the remote was changed: https://github.com/boxen/puppet-repository/pull/16

DanielWright commented 8 years ago

I suspect @DanielWright was stuck using wfarr/nodenv

You are correct. Thanks for making a more robust fix.