guardian / typerighter

Even if you’re the right typer, couldn’t hurt to use Typerighter!
Apache License 2.0
276 stars 12 forks source link

Remove setting up node version from script #390

Closed samanthagottlieb closed 1 year ago

samanthagottlieb commented 1 year ago

What does this change?

This removes the steps that try to set up the correct node version from the check-node-version script. These changes were added here. However they were preventing me from running the start-manager locally, with the script exiting at this line:

[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

@Fweddi and I looked at this together and didn't find the exact cause of the issue. Rather than adding more code to handle whether someone has fnm, nvm, asdf etc. and where it might be installed (e.g. homebrew installs it somewhere specific), we thought it would be better to remove this code and simply notify someone they're using the wrong node version, allowing them to change versions manually themselves.

Now if someone tries to run the script locally and they have the wrong version, the script will simply print an error message letting them know they're using wrong version of node and will then exit. This matches behaviour if you're using the wrong java version. This PR also changes the exit code if you have the wrong java version to reflect the operation not being permitted.

How to test

Change node versions and try running the start-manager or start script. You should see an error message explaining you're using the wrong node version and the script should exit.