Almouro / bitrise-nvm-step

Bitrise step for installing NVM and custom NPM version
http://bitrise.io
MIT License
5 stars 7 forks source link

Honor .nvmrc if it's present #2

Closed StevePotter closed 6 years ago

StevePotter commented 7 years ago

We use the .nvmrc file to store the Node version we want to install. Have you considered checking for this and if it exists, using it instead of the node_version input param? Because now I have to put the node version in two places - .nvmrc and bitrise.yaml

Thanks!

Almouro commented 7 years ago

Hi @StevePotter, thanks for suggesting this, it's a good idea!

I won't have time to work on this for a few days, but feel free to submit a PR of course :)

jasonfma commented 7 years ago

Would it be as simple as removing the required flag on the node version field? The script runs nvm install ${node_version} so if that field is empty would it just run nvm install and use the version from .nvmrc? If so I can submit a PR for that change.

Almouro commented 7 years ago

Hi @jasonfma, you're right, since this commit it should work!

You also will have to remove the default version here: https://github.com/Almouro/bitrise-nvm-step/blob/master/step.yml#L28

Then you can test it on Bitrise by sharing it (https://github.com/Almouro/bitrise-nvm-step#share-your-own-step) and using your fork of the Bitrise step lib https://github.com/bitrise-io/bitrise-steplib

I'll have more time this weekend, if need be :)

Almouro commented 6 years ago

I created a PR for it. Just need to wait for the new version to be merged in the Bitrise step lib now :) https://github.com/bitrise-io/bitrise-steplib/pull/1277

jasonfma commented 6 years ago

Thanks!